From 7417be10066edbebe05e908ddaef64408c26bec9 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 9 Jan 2020 11:37:32 +0100 Subject: Fix calling setLastContact on boolean Fixes https://sentry.io/share/issue/e2f18ccec8ea44cf8cfe1dbfa703c802/ Signed-off-by: Christoph Wurst --- lib/Service/SessionService.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/Service/SessionService.php b/lib/Service/SessionService.php index 368b07ba0..9b7dfbd22 100644 --- a/lib/Service/SessionService.php +++ b/lib/Service/SessionService.php @@ -111,6 +111,9 @@ class SessionService { return $this->sessionMapper->deleteInactive($documentId); } + /** + * @return bool|Session + */ public function getSession($documentId, $sessionId, $token) { if ($this->session !== null) { return $this->session; @@ -123,10 +126,9 @@ class SessionService { } } - public function isValidSession($documentId, $sessionId, $token) { - try { - $session = $this->getSession($documentId, $sessionId, $token); - } catch (DoesNotExistException $e) { + public function isValidSession($documentId, $sessionId, $token): bool { + $session = $this->getSession($documentId, $sessionId, $token); + if ($session === false) { return false; } // TODO: move to cache -- cgit v1.2.3