diff --git a/lib/Controller/SessionController.php b/lib/Controller/SessionController.php index 9c6b66d584..fb4c5116e9 100644 --- a/lib/Controller/SessionController.php +++ b/lib/Controller/SessionController.php @@ -113,9 +113,11 @@ public function mention(int $documentId, int $sessionId, string $sessionToken, s private function loginSessionUser(int $documentId, int $sessionId, string $sessionToken) { $currentSession = $this->sessionService->getSession($documentId, $sessionId, $sessionToken); - $user = $this->userManager->get($currentSession->getUserId()); - if ($user !== null) { - $this->userSession->setUser($user); + if ($currentSession !== false) { + $user = $this->userManager->get($currentSession->getUserId()); + if ($user !== null) { + $this->userSession->setUser($user); + } } } }