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 ($permissions[$permission] === true) {
|
||||||
|
|
||||||
if (!$allowDeletedCard && $mapper instanceof CardMapper) {
|
if (!$allowDeletedCard && $mapper instanceof CardMapper) {
|
||||||
|
try {
|
||||||
$card = $mapper->find((int)$id, false);
|
$card = $mapper->find((int)$id, false);
|
||||||
|
} catch (DoesNotExistException $e) {
|
||||||
|
throw new NoPermissionException('Permission denied');
|
||||||
|
}
|
||||||
if ($card->getDeletedAt() > 0) {
|
if ($card->getDeletedAt() > 0) {
|
||||||
throw new NoPermissionException('Card is deleted');
|
throw new NoPermissionException('Card is deleted');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user