fix count(): Argument #1 ($value) must be of type Countable|array, null given

This commit is contained in:
ralf 2024-09-13 08:38:10 +02:00
parent 57fcc04fb0
commit 0573437a3b

View File

@ -266,8 +266,8 @@ class Accounts
{ {
return $this->backend->search($param); return $this->backend->search($param);
}, [], self::READ_CACHE_TIMEOUT); }, [], self::READ_CACHE_TIMEOUT);
$this->total = count($result); $this->total = $result ? count($result) : 0;
if (!empty($param['offset'])) if ($result && !empty($param['offset']))
{ {
return array_slice($result, $param['start'], $param['offset'], true); return array_slice($result, $param['start'], $param['offset'], true);
} }