From a71fb8d7f3a8cab8dd16be142ce271256ecf99cc Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 8 Dec 2022 09:41:08 -0500 Subject: [PATCH] Check for existence of a public contact id before deleting related notifications in Model\Contact - Address part of https://github.com/friendica/friendica/issues/11993#issuecomment-1338134893 --- src/Model/Contact.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 79ddae713a..d3ff4a2ef1 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -3209,8 +3209,9 @@ class Contact self::clearFollowerFollowingEndpointCache($contact['uid']); $cdata = self::getPublicAndUserContactID($contact['id'], $contact['uid']); - - DI::notification()->deleteForUserByVerb($contact['uid'], Activity::FOLLOW, ['actor-id' => $cdata['public']]); + if (!empty($cdata['public'])) { + DI::notification()->deleteForUserByVerb($contact['uid'], Activity::FOLLOW, ['actor-id' => $cdata['public']]); + } } /** -- 2.39.5