Fix monitoring health badge if programstatus has never been set

This commit is contained in:
Eric Lippmann 2017-11-22 11:11:36 +01:00
parent 3db9a1d77f
commit ca803e8f05
1 changed files with 8 additions and 0 deletions

View File

@ -31,6 +31,14 @@ class BackendAvailabilityNavigationItemRenderer extends BadgeNavigationItemRende
array('is_currently_running', 'notifications_enabled') array('is_currently_running', 'notifications_enabled')
) )
->fetchRow(); ->fetchRow();
if ($programStatus === false) {
throw new Exception(sprintf(
mt('monitoring', '%s is currently not up and running'),
MonitoringBackend::instance()->getName()
));
}
return $programStatus; return $programStatus;
} }