From 0706403ef4dfb5d92cb93e5a100700988df7c02b Mon Sep 17 00:00:00 2001 From: Bubka <858858+Bubka@users.noreply.github.com> Date: Fri, 24 May 2024 13:53:24 +0200 Subject: [PATCH] Add early exit if user model is null --- app/Listeners/Authentication/LogoutListener.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Listeners/Authentication/LogoutListener.php b/app/Listeners/Authentication/LogoutListener.php index f0addcb0..36c4ec69 100644 --- a/app/Listeners/Authentication/LogoutListener.php +++ b/app/Listeners/Authentication/LogoutListener.php @@ -34,7 +34,7 @@ class LogoutListener extends AbstractAccessListener */ public function handle(mixed $event) : void { - if (! $event instanceof Logout) { + if (! $event instanceof Logout || $event->user == null) { return; }