From b4a7362241965c1987b761af2c75f70c0db697b1 Mon Sep 17 00:00:00 2001 From: ralf Date: Tue, 24 Sep 2024 12:48:22 +0200 Subject: [PATCH] fix PHP error: count(): Argument #1 ($value) must be of type Countable|array, null given --- api/src/Link/Storage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/Link/Storage.php b/api/src/Link/Storage.php index 451b5f295c..fa4caf6713 100644 --- a/api/src/Link/Storage.php +++ b/api/src/Link/Storage.php @@ -169,7 +169,7 @@ class Storage } } // if query returns exactly limit rows, we assume there are more and therefore set self::$limit_exceeded - self::$limit_exceeded = $offset !== false && count(is_array($id) ? $links : $links[$id]) == $limit; + self::$limit_exceeded = $offset !== false && $links && count(is_array($id) ? $links : ($links[$id]??[])) == $limit; } // catch Illegal mix of collations (ascii_general_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' (1267) // caused by non-ascii chars compared with ascii field uid