Skip to content

Commit

Permalink
fix: prevent null token
Browse files Browse the repository at this point in the history
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Jul 30, 2024
1 parent 4fd2926 commit aa570c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Listener/ShareLinkAccessedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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
}
}
}

0 comments on commit aa570c8

Please sign in to comment.