mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix call to isUnderMaintenance() on null (#10090)
Not sure how people managed to trigger that one...
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user