From d524f55e3eba821177d70c8f94f82c59c7d30b92 Mon Sep 17 00:00:00 2001 From: Philipp Date: Mon, 7 Nov 2022 20:34:05 +0100 Subject: [PATCH] Reduce error-throws :-) --- src/Module/Calendar/Event/Show.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Module/Calendar/Event/Show.php b/src/Module/Calendar/Event/Show.php index c70a680fd..85d4d47a7 100644 --- a/src/Module/Calendar/Event/Show.php +++ b/src/Module/Calendar/Event/Show.php @@ -54,11 +54,7 @@ class Show extends BaseModule throw new HTTPException\UnauthorizedException($this->t('Permission denied.')); } - if (empty($this->parameters['id'])) { - throw new HTTPException\BadRequestException($this->t('Invalid Request')); - } - - $event = Event::getByIdAndUid($this->session->getLocalUserId(), (int)$this->parameters['id'], $this->parameters['nickname'] ?? ''); + $event = Event::getByIdAndUid($this->session->getLocalUserId(), (int)$this->parameters['id'] ?? 0, $this->parameters['nickname'] ?? ''); if (empty($event)) { throw new HTTPException\NotFoundException($this->t('Event not found.'));