From c9abd70e8a31f0583e5b06f2085cf78e8ccea68f Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 14 May 2021 17:15:08 -0600 Subject: [PATCH] Update LikeService, fix authentication bug --- app/Services/LikeService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/LikeService.php b/app/Services/LikeService.php index a1bdeb55f..cb41850e1 100644 --- a/app/Services/LikeService.php +++ b/app/Services/LikeService.php @@ -76,7 +76,7 @@ class LikeService { 'others' => $status->likes_count >= 5, ]; - if(request()->user()->profile_id == $status->profile_id) { + if(request()->user() && request()->user()->profile_id == $status->profile_id) { $res['total_count'] = $status->likes_count; $res['total_count_pretty'] = number_format($res['total_count']); }