Merge pull request #6652 from nextcloud/backport/6646/stable30

[stable30] fix: Catch not found card
This commit is contained in:
Julius Knorr
2025-01-10 13:21:30 +01:00
committed by GitHub

View File

@@ -119,7 +119,11 @@ class PermissionService {
if ($permissions[$permission] === true) {
if (!$allowDeletedCard && $mapper instanceof CardMapper) {
$card = $mapper->find((int)$id, false);
try {
$card = $mapper->find((int)$id, false);
} catch (DoesNotExistException $e) {
throw new NoPermissionException('Permission denied');
}
if ($card->getDeletedAt() > 0) {
throw new NoPermissionException('Card is deleted');
}