Update LikeService, fix authentication bug

This commit is contained in:
Daniel Supernault 2021-05-14 17:15:08 -06:00
parent 3b4add7b8e
commit c9abd70e8a
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 1 additions and 1 deletions

View File

@ -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']);
}