From e8be3f5e185e1cbda38282514230eb21d9282d83 Mon Sep 17 00:00:00 2001 From: Davide Franco Date: Fri, 8 Jul 2011 19:59:23 +0200 Subject: [PATCH] bacula-web: Improved exception handler when no result in countJobs() function - return value is 0 instead of null --- gui/bacula-web/includes/bweb.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gui/bacula-web/includes/bweb.inc.php b/gui/bacula-web/includes/bweb.inc.php index 17be84d6bc..4869f39cad 100644 --- a/gui/bacula-web/includes/bweb.inc.php +++ b/gui/bacula-web/includes/bweb.inc.php @@ -411,7 +411,11 @@ class Bweb extends DB $this->TriggerDBError( 'Unable to get last' . $type . 'jobs status from catalog', $res); }else { $result = $res->fetchRow(); - return array( $label, $result['count'] ); + + if( isset($result['count']) and !empty($result['count']) ) + return $result['count']; + else + return 0; } } // end function GetJobsStatistics() -- 2.39.5