From 0573437a3b84261539c160438fe8fb6ca9fc933b Mon Sep 17 00:00:00 2001 From: ralf Date: Fri, 13 Sep 2024 08:38:10 +0200 Subject: [PATCH] fix count(): Argument #1 ($value) must be of type Countable|array, null given --- api/src/Accounts.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Accounts.php b/api/src/Accounts.php index ef6fe5fd0a..5b371e51a2 100644 --- a/api/src/Accounts.php +++ b/api/src/Accounts.php @@ -266,8 +266,8 @@ class Accounts { return $this->backend->search($param); }, [], self::READ_CACHE_TIMEOUT); - $this->total = count($result); - if (!empty($param['offset'])) + $this->total = $result ? count($result) : 0; + if ($result && !empty($param['offset'])) { return array_slice($result, $param['start'], $param['offset'], true); }