From a13fa77a0922c7df192b8fdcfcfaee10dedba90c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 17 May 2021 12:01:08 +0200 Subject: [PATCH] Fix possible property access on `null` in `SessionHandler::applyPendingUserChange()` --- .../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 3792bc7313..bdc00eb17b 100644 --- a/wcfsetup/install/files/lib/system/session/SessionHandler.class.php +++ b/wcfsetup/install/files/lib/system/session/SessionHandler.class.php @@ -917,14 +917,14 @@ final class SessionHandler extends SingletonFactory $user = $this->getPendingUserChange(); $this->clearPendingUserChange(); - if ($user->userID !== $expectedUser->userID) { - throw new \RuntimeException('Mismatching expectedUser.'); - } - if (!$user) { throw new \BadMethodCallException('No pending user change.'); } + if ($user->userID !== $expectedUser->userID) { + throw new \RuntimeException('Mismatching expectedUser.'); + } + $this->changeUser($user); } -- 2.20.1