]> git.mxchange.org Git - friendica.git/commitdiff
Fixed fatal error about when returned 'body' field is empty:
authorRoland Häder <roland@mxchange.org>
Sun, 29 Jul 2018 15:34:20 +0000 (17:34 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 29 Jul 2018 15:34:20 +0000 (17:34 +0200)
````
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Friendica\Protocol\PortableContact::discoverServer() must be of the type array, null given, called in /var/www/../src/Protocol/PortableContact.php on line 1664 and defined in /var/www/../src/Protocol/PortableContact.php:1765
Stack trace:
````

src/Protocol/PortableContact.php

index 289eee90e9b26685d82f7022482c34fec9a24506..3183a192f79d3e84e964bd0787064f6e1041e220 100644 (file)
@@ -1638,7 +1638,7 @@ class PortableContact
 
                $retdata = Network::curl($url);
 
-               if ($retdata["success"]) {
+               if ($retdata["success"] && !empty($retdata["body"])) {
                        $data = json_decode($retdata["body"], true);
 
                        self::discoverServer($data, 2);
@@ -1659,7 +1659,7 @@ class PortableContact
 
                                $retdata = Network::curl($url);
 
-                               if ($retdata["success"]) {
+                               if ($retdata["success"] && !empty($retdata["body"])) {
                                        logger("Fetch all global contacts from the server " . $server["nurl"], LOGGER_DEBUG);
                                        $success = self::discoverServer(json_decode($retdata["body"], true));
                                }