From 39133a1e0e0b219adae52394186605a6c16f7214 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 13 Sep 2019 18:59:33 +0000 Subject: [PATCH] Fix a notice because of invalid return data --- src/Worker/OnePoll.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Worker/OnePoll.php b/src/Worker/OnePoll.php index 9af4be9bed..d9bdd66fbd 100644 --- a/src/Worker/OnePoll.php +++ b/src/Worker/OnePoll.php @@ -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 "); -- 2.39.5