]> git.mxchange.org Git - friendica.git/commitdiff
Check for existence of a public contact id before deleting related notifications...
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 8 Dec 2022 14:41:08 +0000 (09:41 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 10 Dec 2022 16:42:04 +0000 (11:42 -0500)
- Address part of https://github.com/friendica/friendica/issues/11993#issuecomment-1338134893

src/Model/Contact.php

index 79ddae713a435f162e7eab5d213f51f706c2cbfa..d3ff4a2ef11086e6f2e5317951ee53cafc2beddf 100644 (file)
@@ -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']]);
+               }
        }
 
        /**