From 3666130ea938fd9b686bbfa6a06561865519d30d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 9 Aug 2022 09:43:52 +0200 Subject: [PATCH] Initialize LegacySession with `null` Otherwise ACP will access an uninitialized property during shutdown. see 0867fa82fd1faaf2e1e9192102cae97a9759df70 --- .../files/lib/system/session/SessionHandler.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php index 39bfd403d1..3259c99834 100644 --- a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php +++ b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php @@ -74,7 +74,7 @@ final class SessionHandler extends SingletonFactory */ private string $sessionID; - protected ?LegacySession $legacySession; + protected ?LegacySession $legacySession = null; /** * user object @@ -589,7 +589,7 @@ final class SessionHandler extends SingletonFactory $legacySessionStatement->execute($condition->getParameters()); $this->legacySession = $legacySessionStatement->fetchSingleObject(LegacySession::class); - if (!$this->legacySession) { + if ($this->legacySession === null) { try { $this->legacySession = $this->createLegacySession(); } catch (DatabaseQueryExecutionException $e) { @@ -666,7 +666,7 @@ final class SessionHandler extends SingletonFactory $this->legacySession = $statement->fetchSingleObject(LegacySession::class); } - if (!$this->legacySession) { + if ($this->legacySession === null) { $this->legacySession = $this->createLegacySession(); } } @@ -1159,7 +1159,7 @@ final class SessionHandler extends SingletonFactory } } - if ($this->legacySession) { + if ($this->legacySession !== null) { $sessionEditor = new SessionEditor($this->legacySession); $sessionEditor->update($data); } -- 2.20.1