浏览代码

Add early exit if user model is null

Bubka 1 年之前
父节点
当前提交
0706403ef4
共有 1 个文件被更改,包括 1 次插入1 次删除
  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;
         }