Skip to content

Commit

Permalink
fix: Catch not found card
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Knorr <[email protected]>
  • Loading branch information
juliusknorr authored and backportbot[bot] committed Jan 10, 2025
1 parent dfdc148 commit 5d10968
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Service/PermissionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ public function checkPermission(?IPermissionMapper $mapper, $id, int $permission
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');
}
Expand Down

0 comments on commit 5d10968

Please sign in to comment.