From 4fbcb2318c91c77080d5977b17f9ae8d53f2e54f Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Mon, 26 Feb 2024 15:48:47 +0100 Subject: [PATCH] fix error when there are no servers --- pandora_console/general/header.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 5eee6a6669..5502fec94f 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -54,7 +54,14 @@ echo sprintf('
', $menuTypeClass); // ======= Servers List =============================================== if ((bool) check_acl($config['id_user'], 0, 'AW') !== false) { $servers = []; - $servers['all'] = (int) count((servers_get_info() ?? [])); + $servers_info = servers_get_info(); + + $servers['all'] = 0; + + if ($servers_info !== null && $servers_info !== false) { + $servers['all'] = (int) count($servers_info); + } + if ($servers['all'] != 0) { $servers['up'] = (int) servers_check_status(); $servers['down'] = ($servers['all'] - $servers['up']);