Explorar o código

Update LikeService, improve likedBy logic to soft fail on missing or deleted accounts

Daniel Supernault %!s(int64=2) %!d(string=hai) anos
pai
achega
91ba139808
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      app/Services/LikeService.php

+ 4 - 1
app/Services/LikeService.php

@@ -85,7 +85,10 @@ class LikeService {
 				return $empty;
 			}
 			$id = $like->profile_id;
-			$profile = ProfileService::get($id);
+			$profile = ProfileService::get($id, true);
+			if(!$profile) {
+				return [];
+			}
 			$profileUrl = "/i/web/profile/{$profile['id']}";
 			$res = [
 				'id' => (string) $profile['id'],