]> git.mxchange.org Git - friendica.git/commitdiff
Silently quit on unfollow of invalid contacts
authorMichael <heluecht@pirati.ca>
Thu, 24 Nov 2022 05:17:14 +0000 (05:17 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 24 Nov 2022 05:17:14 +0000 (05:17 +0000)
src/Core/Protocol.php

index 015612adeaea1af9575727792f25b89ef41e965c..511954c7f93a14fd0685e08cb5373b14a947fba2 100644 (file)
@@ -182,7 +182,8 @@ class Protocol
        public static function unfollow(array $contact, array $user): ?bool
        {
                if (empty($contact['network'])) {
-                       throw new \InvalidArgumentException('Missing network key in contact array');
+                       Logger::notice('Contact has got no network, we quit here', ['id' => $contact['id']]);
+                       return true;
                }
 
                $protocol = $contact['network'];
@@ -205,7 +206,8 @@ class Protocol
                        $slap = OStatus::salmon($item, $user);
 
                        if (empty($contact['notify'])) {
-                               throw new \InvalidArgumentException('Missing expected "notify" key in OStatus/DFRN contact');
+                               Logger::notice('OStatus/DFRN Contact is missing notify, we quit here', ['id' => $contact['id']]);
+                               return true;
                        }
 
                        return Salmon::slapper($user, $contact['notify'], $slap) === 0;