Skip to content

Commit

Permalink
Fix calling setLastContact on boolean (#526)
Browse files Browse the repository at this point in the history
Fix calling setLastContact on boolean
  • Loading branch information
juliusknorr authored Jan 9, 2020
2 parents 2546050 + 43c0277 commit bf1068c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/Service/SessionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ public function removeInactiveSessions($documentId = -1) {
return $this->sessionMapper->deleteInactive($documentId);
}

/**
* @return bool|Session
*/
public function getSession($documentId, $sessionId, $token) {
if ($this->session !== null) {
return $this->session;
Expand All @@ -123,10 +126,9 @@ public function getSession($documentId, $sessionId, $token) {
}
}

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
Expand Down

0 comments on commit bf1068c

Please sign in to comment.