diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-01-09 13:37:32 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-01-09 13:37:32 +0300 |
commit | 43c0277375c8550bb56bdc746669d197cbe5ff5b (patch) | |
tree | 52d2e0215cb221facebd8aabea370bdfcedafc4c /lib/Service/SessionService.php | |
parent | 254605056e6ce90e2f06c5d06391912cb78605f0 (diff) |
Fix calling setLastContact on boolean
Fixes https://sentry.io/share/issue/e2f18ccec8ea44cf8cfe1dbfa703c802/
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Service/SessionService.php')
-rw-r--r-- | lib/Service/SessionService.php | 10 |
1 files changed, 6 insertions, 4 deletions
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 |