]> git.mxchange.org Git - friendica.git/commitdiff
Avoid warnings
authorMichael <heluecht@pirati.ca>
Sun, 28 Aug 2022 09:12:36 +0000 (09:12 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 28 Aug 2022 09:12:36 +0000 (09:12 +0000)
src/Model/GServer.php

index 08cefba56c244793718aef27540c947965597ff4..9801ea9c6f84afcb6958ceb11782c5062e2727b8 100644 (file)
@@ -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);
+                                       }       
                                }
                        }
                }