mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Avoid null device error in deviceLink (#10882)
This commit is contained in:
@@ -46,12 +46,16 @@ class Url
|
||||
*/
|
||||
public static function deviceLink($device, $text = null, $vars = [], $start = 0, $end = 0, $escape_text = 1, $overlib = 1)
|
||||
{
|
||||
if (is_null($device)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (!$device->canAccess(Auth::user())) {
|
||||
return $device->displayName();
|
||||
}
|
||||
|
||||
if (!$start) {
|
||||
$start = Carbon::now()->subDay(1)->timestamp;
|
||||
$start = Carbon::now()->subDay()->timestamp;
|
||||
}
|
||||
|
||||
if (!$end) {
|
||||
|
Reference in New Issue
Block a user