From 91ba139808b78208a097b19ddec5a36023a874b0 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Mon, 8 May 2023 22:47:59 -0600 Subject: [PATCH] Update LikeService, improve likedBy logic to soft fail on missing or deleted accounts --- app/Services/LikeService.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Services/LikeService.php b/app/Services/LikeService.php index bc6b876ae..34a2417d0 100644 --- a/app/Services/LikeService.php +++ b/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'],