API: Make sure memberships is an array to avoid other errors (PHP 8.0)

This commit is contained in:
nathan 2021-10-27 13:38:05 -06:00
parent 0bac2ff1e8
commit a794adfcf2

View File

@ -986,7 +986,7 @@ class Accounts
} }
if ($account_id && ($data = self::cache_read($account_id))) 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)); //error_log(__METHOD__."($account_id, $just_id) data=".array2string($data)." returning ".array2string($ret));
return $ret ?? []; return $ret ?? [];