Skip to content

A free open source IT asset/license management system

Only return location name if find is valid

snipe8572a9771b0f
diff --git a/resources/views/partials/forms/edit/location-select.blade.php b/resources/views/partials/forms/edit/location-select.blade.php
index 99865af174..67b10d428b 100644
--- a/resources/views/partials/forms/edit/location-select.blade.php
+++ b/resources/views/partials/forms/edit/location-select.blade.php
@@ -6,7 +6,7 @@
<select class="js-data-ajax" data-endpoint="locations" name="{{ $fieldname }}" style="width: 100%" id="{{ $fieldname }}_location_select">
@if ($location_id = Input::old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
<option value="{{ $location_id }}" selected="selected">
- {{ \App\Models\Location::find($location_id)->name }}
+ {{ (\App\Models\Location::find($location_id)) ? \App\Models\Location::find($location_id)->name : '' }}
</option>
@else
<option value="">{{ trans('general.select_location') }}</option>