From 5d109684fc1c555295082a0e15f97542f8fbfd0a Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Fri, 3 Jan 2025 14:48:00 +0100 Subject: [PATCH] fix: Catch not found card Signed-off-by: Julius Knorr --- lib/Service/PermissionService.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Service/PermissionService.php b/lib/Service/PermissionService.php index eec3474c3..7bfa684a9 100644 --- a/lib/Service/PermissionService.php +++ b/lib/Service/PermissionService.php @@ -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'); }