mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
fix(source): guard against empty teams page when computing cursor
end([]) returns false, and PHP's nullsafe operator (?->) only short-circuits on null. end($empty)?->id therefore throws TypeError when the teams response is empty, breaking reportAuth for accounts without teams. Replace with an explicit empty check.
This commit is contained in:
1 parent
a9bdfba24c
commit
4dc7270849
1 file changed
+1
-1
@@ -308,7 +308,7 @@ class Appwrite extends Source
|
|||||||
$currentTeams = $teamList->teams;
|
$currentTeams = $teamList->teams;
|
||||||
|
|
||||||
$allTeams = array_merge($allTeams, $currentTeams);
|
$allTeams = array_merge($allTeams, $currentTeams);
|
||||||
$lastTeam = end($currentTeams)?->id ?? null;
|
$lastTeam = empty($currentTeams) ? null : end($currentTeams)->id;
|
||||||
|
|
||||||
if (count($currentTeams) < self::DEFAULT_PAGE_LIMIT) {
|
if (count($currentTeams) < self::DEFAULT_PAGE_LIMIT) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in new issue
Block a user