]> git.mxchange.org Git - friendica.git/commitdiff
Fix a notice because of invalid return data
authorMichael <heluecht@pirati.ca>
Fri, 13 Sep 2019 18:59:33 +0000 (18:59 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 13 Sep 2019 18:59:33 +0000 (18:59 +0000)
src/Worker/OnePoll.php

index 9af4be9bed32185f964962adb43956151daf1ea3..d9bdd66fbd28b2c0aae0135aa532e924bf9a125a 100644 (file)
@@ -301,6 +301,15 @@ class OnePoll
 
                $res = XML::parseString($handshake_xml);
 
+               if (!is_object($res)) {
+                       Logger::info('Unparseable response', ['url' => $url]);
+
+                       $fields = ['last-update' => $updated, 'failure_update' => $updated];
+                       self::updateContact($contact, $fields);
+                       Contact::markForArchival($contact);
+                       return false;
+               }
+
                if (intval($res->status) == 1) {
                        // we may not be friends anymore. Will keep trying for one month.
                        Logger::log("$url replied status 1 - marking for death ");