Skip to content

A free open source IT asset/license management system

Guard last_checkout against null before calling diffForHumans

copilot-swe-agent[bot]9d40df179df4
diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php
index 5cbd19c9f8..87c9b2cfd6 100755
--- a/resources/views/hardware/view.blade.php
+++ b/resources/views/hardware/view.blade.php
@@ -167,8 +167,12 @@
<x-well>
<x-icon type="calendar" class="fa-fw"/>
<strong>{{ trans('general.last_checkout') }}</strong>
- {{ Helper::getFormattedDateObject($asset->last_checkout, 'date', false) }}
- <span class="text-muted">{{ Carbon::parse($asset->last_checkout)->diffForHumans(['parts' => 2]) }}</span>
+ @if ($asset->last_checkout != '')
+ {{ Helper::getFormattedDateObject($asset->last_checkout, 'date', false) }}
+ <span class="text-muted">{{ Carbon::parse($asset->last_checkout)->diffForHumans(['parts' => 2]) }}</span>
+ @else
+ {{ trans('general.na') }}
+ @endif
</x-well>
</x-page-column>