Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix potential crash when trying to use the document session's user wh…
…en the session is not found

Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc authored and backportbot[bot] committed Apr 16, 2024
commit cb577b8306dd0b8faae31db74d481f8acbd147b8
8 changes: 5 additions & 3 deletions lib/Controller/SessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ public function sync(int $documentId, int $sessionId, string $sessionToken, int

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);
}
}
}
}