From aa570c88d48b51e5e0bc4209ea20542e730fc202 Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Tue, 30 Jul 2024 18:20:56 +0200 Subject: [PATCH] fix: prevent null token Signed-off-by: skjnldsv --- lib/Listener/ShareLinkAccessedListener.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Listener/ShareLinkAccessedListener.php b/lib/Listener/ShareLinkAccessedListener.php index 2f9f460..ce3e45d 100644 --- a/lib/Listener/ShareLinkAccessedListener.php +++ b/lib/Listener/ShareLinkAccessedListener.php @@ -54,8 +54,8 @@ public function handle(Event $event): void { } // Make sure we have a valid limit - $token = $event->getShare()->getToken(); try { + $token = $event->getShare()->getToken(); $shareLimit = $this->mapper->get($token); $limit = $shareLimit->getLimit(); @@ -76,6 +76,8 @@ public function handle(Event $event): void { $this->mapper->update($shareLimit); } catch (DoesNotExistException $e) { // No limit is set, ignore + } catch (\Exception $e) { + // Something went wrong, ignore } } }