Ver Fonte

Update LikeService, fix authentication bug

Daniel Supernault há 4 anos atrás
pai
commit
c9abd70e8a
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      app/Services/LikeService.php

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