From 3052ae71b74e45a6624797d0748313bbd0266c8d Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 28 Aug 2022 09:12:36 +0000 Subject: [PATCH] Avoid warnings --- src/Model/GServer.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); + } } } }