mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 02:18:39 +00:00
Handle missing device when linking (#16164)
* Handle missing device when linking Sometimes a device is gone, but data still points to it. Prevent error when that happens (even though it should not) * Handle more gracefully * Remove original work around * Allow unsaved devices, we just need device_id really
This commit is contained in:
parent
afba58cb29
commit
108727c500
@ -46,6 +46,10 @@ class DeviceLink extends Component
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
if (empty($this->device->device_id)) {
|
||||
return view('components.device-link-missing');
|
||||
}
|
||||
|
||||
if (! $this->device->canAccess(auth()->user())) {
|
||||
return view('components.device-link-no-access');
|
||||
}
|
||||
|
1
resources/views/components/device-link-missing.blade.php
Normal file
1
resources/views/components/device-link-missing.blade.php
Normal file
@ -0,0 +1 @@
|
||||
<span class="tw-font-bold">{{ $slot->isNotEmpty() ? $slot : '' }}</span>
|
Loading…
Reference in New Issue
Block a user