Browse Source

Update AuthLogin listener

Daniel Supernault 6 years ago
parent
commit
abc738a532
1 changed files with 5 additions and 0 deletions
  1. 5 0
      app/Listeners/AuthLogin.php

+ 5 - 0
app/Listeners/AuthLogin.php

@@ -25,6 +25,11 @@ class AuthLogin
     public function handle($event)
     public function handle($event)
     {
     {
         $user = $event->user;
         $user = $event->user;
+
+        if(!$user) {
+            return;
+        }
+
         if (empty($user->settings)) {
         if (empty($user->settings)) {
             DB::transaction(function() use($user) {
             DB::transaction(function() use($user) {
                 UserSetting::firstOrCreate([
                 UserSetting::firstOrCreate([