Browse Source

Add early exit if user model is null

Bubka 1 year ago
parent
commit
0706403ef4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/Listeners/Authentication/LogoutListener.php

+ 1 - 1
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;
         }