fix call to isUnderMaintenance() on null (#10090)

Not sure how people managed to trigger that one...
This commit is contained in:
Tony Murray
2019-04-18 10:14:17 -05:00
committed by GitHub
parent d5ea3d42bd
commit d901d308d2

View File

@@ -158,7 +158,8 @@ function GetRules($device_id)
*/
function IsMaintenance($device_id)
{
return \App\Models\Device::find($device_id)->isUnderMaintenance();
$device = \App\Models\Device::find($device_id);
return !is_null($device) && $device->isUnderMaintenance();
}
/**
* Run all rules for a device