Handle Zones without monitor

This commit is contained in:
Isaac Connor 2020-04-09 20:41:34 -04:00
parent 7f5f0198b3
commit 40d386fe6c
1 changed files with 4 additions and 2 deletions

View File

@ -156,8 +156,10 @@ foreach ( dbFetchAll('SELECT `Id`, `Name` FROM `Monitors` ORDER BY lower(`Name`)
$zones = array();
foreach ( dbFetchAll('SELECT Id, Name, MonitorId FROM Zones ORDER BY lower(`Name`) ASC') as $zone ) {
if ( visibleMonitor($zone['MonitorId']) ) {
$zone['Name'] = validHtmlStr($monitors[$zone['MonitorId']]->Name().': '.$zone['Name']);
$zones[$zone['Id']] = new ZM\Zone($zone);
if ( isset($monitors[$zone['MonitorId']]) ) {
$zone['Name'] = validHtmlStr($monitors[$zone['MonitorId']]->Name().': '.$zone['Name']);
$zones[$zone['Id']] = new ZM\Zone($zone);
}
}
}