From facdf2d119ce1b28391c2c8d1cef7aece368849a Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 27 Oct 2021 13:38:05 -0600 Subject: [PATCH] API: Make sure memberships is an array to avoid other errors (PHP 8.0) --- api/src/Accounts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/Accounts.php b/api/src/Accounts.php index 69c9def084..f7cc06c5ae 100644 --- a/api/src/Accounts.php +++ b/api/src/Accounts.php @@ -986,7 +986,7 @@ class Accounts } if ($account_id && ($data = self::cache_read($account_id))) { - $ret = $just_id && $data['memberships'] ? array_keys($data['memberships']) : $data['memberships']; + $ret = $just_id && $data['memberships'] ? array_keys($data['memberships']) : ($data['memberships'] ?? []); } //error_log(__METHOD__."($account_id, $just_id) data=".array2string($data)." returning ".array2string($ret)); return $ret ?? [];