Fix eventlog when the device has been deleted. (#9276)

This commit is contained in:
Tony Murray
2018-10-01 20:03:06 -05:00
committed by GitHub
parent c9bbaf5a9f
commit ac677a99ee

View File

@@ -65,7 +65,7 @@ class EventlogController extends TableController
{
return [
'datetime' => $this->formatDatetime($eventlog),
'device_id' => Url::deviceLink($eventlog->device, $eventlog->device->shortDisplayName()),
'device_id' => $eventlog->device ? Url::deviceLink($eventlog->device, $eventlog->device->shortDisplayName()) : null,
'type' => $this->formatType($eventlog),
'message' => htmlspecialchars($eventlog->message),
'username' => $eventlog->username ?: 'System',