Przeglądaj źródła

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

Daniel Supernault 2 lat temu
rodzic
commit
91ba139808
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4 1
      app/Services/LikeService.php

+ 4 - 1
app/Services/LikeService.php

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