From: Michael Date: Sun, 28 Aug 2022 09:12:36 +0000 (+0000) Subject: Avoid warnings X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3052ae71b74e45a6624797d0748313bbd0266c8d;p=friendica.git Avoid warnings --- diff --git a/src/Model/GServer.php b/src/Model/GServer.php index 08cefba56c..9801ea9c6f 100644 --- a/src/Model/GServer.php +++ b/src/Model/GServer.php @@ -2164,9 +2164,11 @@ class GServer if ($curlResult->isSuccess()) { $servers = json_decode($curlResult->getBody(), true); - foreach ($servers['instances'] as $server) { - $url = (is_null($server['https_score']) ? 'http' : 'https') . '://' . $server['name']; - self::add($url); + if (!empty($servers['instances'])) { + foreach ($servers['instances'] as $server) { + $url = (is_null($server['https_score']) ? 'http' : 'https') . '://' . $server['name']; + self::add($url); + } } } }