Browse Source

Update SiteController

Daniel Supernault 5 years ago
parent
commit
b793f9c4bb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/Http/Controllers/SiteController.php

+ 1 - 1
app/Http/Controllers/SiteController.php

@@ -116,7 +116,7 @@ class SiteController extends Controller
         ]);
         ]);
         $profile = Profile::whereUsername($request->input('user'))->firstOrFail();
         $profile = Profile::whereUsername($request->input('user'))->firstOrFail();
         $user = $request->user();
         $user = $request->user();
-        abort_if($profile->id == $user->profile_id, 404);
+        abort_if($user && $profile->id == $user->profile_id, 404);
         $following = $user != null ? FollowerService::follows($user->profile_id, $profile->id) : false;
         $following = $user != null ? FollowerService::follows($user->profile_id, $profile->id) : false;
         return view('site.intents.follow', compact('profile', 'user', 'following'));
         return view('site.intents.follow', compact('profile', 'user', 'following'));
     }
     }