Fixed fatal error about when returned 'body' field is empty:
```` 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: ````
This commit is contained in:
parent
02d4b1098e
commit
650c3c18e1
1 changed files with 2 additions and 2 deletions
|
@ -1638,7 +1638,7 @@ class PortableContact
|
||||||
|
|
||||||
$retdata = Network::curl($url);
|
$retdata = Network::curl($url);
|
||||||
|
|
||||||
if ($retdata["success"]) {
|
if ($retdata["success"] && !empty($retdata["body"])) {
|
||||||
$data = json_decode($retdata["body"], true);
|
$data = json_decode($retdata["body"], true);
|
||||||
|
|
||||||
self::discoverServer($data, 2);
|
self::discoverServer($data, 2);
|
||||||
|
@ -1659,7 +1659,7 @@ class PortableContact
|
||||||
|
|
||||||
$retdata = Network::curl($url);
|
$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);
|
logger("Fetch all global contacts from the server " . $server["nurl"], LOGGER_DEBUG);
|
||||||
$success = self::discoverServer(json_decode($retdata["body"], true));
|
$success = self::discoverServer(json_decode($retdata["body"], true));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue