Handle missing resource token collection (#12625)

This commit is contained in:
Chirag Aggarwal authored and GitHub committed 2026-06-19 18:11:25 +05:30
1 parent fde5d022dd
commit 0cf4722597
1 file changed
+5 -1
+5 -1
View File
@@ -1108,7 +1108,11 @@ return function (Container $context): void {
return new Document([]);
}
$token = $authorization->skip(fn () => $dbForProject->getDocument('resourceTokens', $tokenId));
try {
$token = $authorization->skip(fn () => $dbForProject->getDocument('resourceTokens', $tokenId));
} catch (\Utopia\Database\Exception\NotFound) {
return new Document([]);
}
if ($token->isEmpty()) {
return new Document([]);