From 1743008ddd82cd7dc93f20e924c4401842578fbf Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Tue, 23 May 2023 10:30:49 +0200 Subject: [PATCH] #11323 fixed error 500 when graph not has data --- pandora_console/include/functions_reporting.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 5adae9abf7..0f613890d5 100755 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -15832,7 +15832,11 @@ function reporting_module_histogram_graph($report, $content, $pdf=0) $return['time_critical'] = $data['time_error']; $return['time_warning'] = $data['time_warning']; $return['time_ok'] = $data['time_ok']; - $return['percent_ok'] = (($data['checks_ok'] * 100) / $data['checks_total']); + if ($data['checks_total'] > 0) { + $return['percent_ok'] = (($data['checks_ok'] * 100) / $data['checks_total']); + } else { + $return['percent_ok'] = 0; + } $colors = [ 1 => COL_NORMAL,