From 2f1559a4902bc09d57f38a4bb9b8baa408d7deaf Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 5 Nov 2021 15:18:57 +0100 Subject: [PATCH] fix PHP 8.0 TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given --- api/src/Mail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);