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:
Prem Palanisamy committed 2026-05-11 02:37:10 +01:00
1 parent a9bdfba24c
commit 4dc7270849
1 file changed
+1 -1
+1 -1
View File
@@ -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;