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:
Tony Murray 2024-06-28 01:48:11 -05:00 committed by GitHub
parent afba58cb29
commit 108727c500
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -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');
}

View File

@ -0,0 +1 @@
<span class="tw-font-bold">{{ $slot->isNotEmpty() ? $slot : '' }}</span>