Parcourir la source

Add early exit if user model is null

Bubka il y a 1 an
Parent
commit
0706403ef4
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  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
     public function handle(mixed $event) : void
     {
     {
-        if (! $event instanceof Logout) {
+        if (! $event instanceof Logout || $event->user == null) {
             return;
             return;
         }
         }