Merge pull request #5522 from Quix0r/fixes/portable-contact-empty-body

Fixed fatal error about when returned 'body' field is empty
This commit is contained in:
Michael Vogel 2018-07-30 04:40:25 +02:00 committed by GitHub
commit a82cd6313d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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));
} }