From 47b3f5c239894c8d77e34cc77340bbebe7a03da0 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 19 Nov 2021 13:00:51 +0100 Subject: [PATCH] fix PHP 8.0 TypeError: array_keys(): Argument #1 ($array) must be of type array, null given --- api/src/Contacts/Sql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/Contacts/Sql.php b/api/src/Contacts/Sql.php index 3dfc932ac2..50c7edd81d 100644 --- a/api/src/Contacts/Sql.php +++ b/api/src/Contacts/Sql.php @@ -513,7 +513,7 @@ class Sql extends Api\Storage $shared_sql = $this->table_name.'.contact_id IN (SELECT contact_id FROM '.self::SHARED_TABLE.' WHERE '. // $filter[tid] === null is used by sync-collection report, in which case we need to return deleted shares, to remove them from devices (array_key_exists('tid', $filter) && !isset($filter['tid']) ? '' : 'shared_deleted IS NULL AND '). - $this->db->expression(self::SHARED_TABLE, ['shared_with' => $filter['owner'] ?? array_keys($this->grants)]).')'; + $this->db->expression(self::SHARED_TABLE, ['shared_with' => $filter['owner'] ?? array_keys($this->grants ?? [0])]).')'; } // add filter for read ACL in sql, if user is NOT the owner of the addressbook