mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Check that the model is valid before trying to chain the relationship
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
7f761000b4
commit
1a771e6ab9
|
@ -75,8 +75,7 @@
|
||||||
@if (!$asset->model)
|
@if (!$asset->model)
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="callout callout-danger">
|
<div class="callout callout-danger">
|
||||||
<h2>{{ trans('admin/models/message.no_association') }}</h2>
|
<p><strong>{{ trans('admin/models/message.no_association') }}</strong> {{ trans('admin/models/message.no_association_fix') }}</p>
|
||||||
<p>{{ trans('admin/models/message.no_association_fix') }}</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
@ -183,7 +182,7 @@
|
||||||
</span>
|
</span>
|
||||||
<span class="hidden-xs hidden-sm">
|
<span class="hidden-xs hidden-sm">
|
||||||
{{ trans('general.additional_files') }}
|
{{ trans('general.additional_files') }}
|
||||||
{!! ($asset->model->uploads->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($asset->model->uploads->count()).'</badge>' : '' !!}
|
{!! ($asset->model) && ($asset->model->uploads->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($asset->model->uploads->count()).'</badge>' : '' !!}
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -626,7 +625,7 @@
|
||||||
{{ $asset->warranty_months }}
|
{{ $asset->warranty_months }}
|
||||||
{{ trans('admin/hardware/form.months') }}
|
{{ trans('admin/hardware/form.months') }}
|
||||||
|
|
||||||
@if (($asset->model->manufacturer) && ($asset->model->manufacturer->warranty_lookup_url!=''))
|
@if (($asset->model) && ($asset->model->manufacturer) && ($asset->model->manufacturer->warranty_lookup_url!=''))
|
||||||
<a href="{{ $asset->present()->dynamicWarrantyUrl() }}" target="_blank">
|
<a href="{{ $asset->present()->dynamicWarrantyUrl() }}" target="_blank">
|
||||||
<i class="fa fa-external-link" aria-hidden="true"><span class="sr-only">{{ trans('admin/hardware/general.mfg_warranty_lookup', ['manufacturer' => $asset->model->manufacturer->name]) }}</span></i>
|
<i class="fa fa-external-link" aria-hidden="true"><span class="sr-only">{{ trans('admin/hardware/general.mfg_warranty_lookup', ['manufacturer' => $asset->model->manufacturer->name]) }}</span></i>
|
||||||
</a>
|
</a>
|
||||||
|
@ -1305,7 +1304,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
@if ($asset->model->uploads->count() > 0)
|
@if (($asset->model) && ($asset->model->uploads->count() > 0))
|
||||||
<table
|
<table
|
||||||
class="table table-striped snipe-table"
|
class="table table-striped snipe-table"
|
||||||
id="assetModelFileHistory"
|
id="assetModelFileHistory"
|
||||||
|
|
Loading…
Reference in a new issue