diff --git a/api/src/Mail.php b/api/src/Mail.php index 0f23660050..5642fba221 100644 --- a/api/src/Mail.php +++ b/api/src/Mail.php @@ -5062,7 +5062,7 @@ class Mail static function &getdisplayableBody(&$mailClass, $bodyParts, $preserveHTML = false, $useTidy = true) { $message=''; - for($i=0, $cnt=count($bodyParts); $i < $cnt; $i++) + for($i=0, $cnt=count($bodyParts ?? []); $i < $cnt; $i++) { if (!isset($bodyParts[$i]['body'])) { $bodyParts[$i]['body'] = self::getdisplayableBody($mailClass, $bodyParts[$i], $preserveHTML, $useTidy);