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

This commit is contained in:
Daniel Supernault 2023-05-08 22:47:59 -06:00
parent df444851b5
commit 91ba139808
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -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'],