From de7f4329ffde25d61081c316a1bf8127d5322fc1 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 5 Nov 2021 14:37:21 +0100 Subject: [PATCH] fix PHP 8.0 TypeError: uasort(): Argument #1 ($array) must be of type array, null given --- api/src/Mail.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Mail.php b/api/src/Mail.php index cee470c3aa..0f23660050 100644 --- a/api/src/Mail.php +++ b/api/src/Mail.php @@ -3067,7 +3067,7 @@ class Mail $folders = $this->icServer->getMailboxes($path, $_search, true); } - uasort($folders,array($this,'sortByMailbox'));//ksort($folders); + if (is_array($folders)) uasort($folders, array($this,'sortByMailbox')); } elseif(!$_nodePath) // all { @@ -3088,7 +3088,7 @@ class Mail if (self::$debugTimes) $starttime = microtime (true); // Merge of all auto folders and specialusefolders $autoFoldersTmp = array_unique((array_merge(self::$autoFolders, array_values(self::$specialUseFolders)))); - uasort($folders,array($this,'sortByMailbox'));//ksort($folders); + if (is_array($folders)) uasort($folders,array($this,'sortByMailbox'));//ksort($folders); $tmpFolders = $folders; $inboxFolderObject=$inboxSubFolderObjects=$autoFolderObjects=$typeFolderObject=$mySpecialUseFolders=array(); $googleMailFolderObject=$googleAutoFolderObjects=$googleSubFolderObjects=array();