]> git.sur5r.net Git - bacula/bacula/commitdiff
bacula-web: Improved exception handler when no result in countJobs() function
authorDavide Franco <bacula-dev@dflc.ch>
Fri, 8 Jul 2011 17:59:23 +0000 (19:59 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:49:21 +0000 (14:49 +0200)
 - return value is 0 instead of null

gui/bacula-web/includes/bweb.inc.php

index 17be84d6bc3852a313bd2b916f8f4bdd76cae582..4869f39cad1b524f2fd96b70fca39e779391fc5d 100644 (file)
@@ -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()