From 4dc72708497729f1aacb133a814bb5b0adab5a8d Mon Sep 17 00:00:00 2001 From: Prem Palanisamy Date: Mon, 11 May 2026 02:37:10 +0100 Subject: [PATCH] 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. --- src/Migration/Sources/Appwrite.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Migration/Sources/Appwrite.php b/src/Migration/Sources/Appwrite.php index 2b5906d887..94368e5e88 100644 --- a/src/Migration/Sources/Appwrite.php +++ b/src/Migration/Sources/Appwrite.php @@ -308,7 +308,7 @@ class Appwrite extends Source $currentTeams = $teamList->teams; $allTeams = array_merge($allTeams, $currentTeams); - $lastTeam = end($currentTeams)?->id ?? null; + $lastTeam = empty($currentTeams) ? null : end($currentTeams)->id; if (count($currentTeams) < self::DEFAULT_PAGE_LIMIT) { break;