From 967b43061dd12446a2fe03615ea4018147eef860 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 28 Mar 2017 11:59:30 +0200 Subject: [PATCH] Added not init state if there are no initialized modules --- pandora_console/include/functions_agents.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 5455dab2bf..d998d9ea1f 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -1739,6 +1739,10 @@ function agents_get_status($id_agent = 0, $noACLs = false) { } } + if (!isset($modules) || empty($modules) || count($modules) == 0) { + return AGENT_MODULE_STATUS_NOT_INIT; + } + $modules_status = array(); $modules_async = 0; foreach ($modules as $module) {