fix: Catch not found card
Signed-off-by: Julius Knorr <jus@bitgrid.net>
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user