mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Check for validity before trying to display relation data
This commit is contained in:
parent
b462888850
commit
f642013774
|
@ -23,11 +23,11 @@ class AssetsTransformer
|
|||
'name' => $asset->name,
|
||||
'asset_tag' => $asset->asset_tag,
|
||||
'serial' => $asset->serial,
|
||||
'model' => $asset->model->name,
|
||||
'model' => ($asset->model) ? $asset->model->name : '',
|
||||
'model_number' => $asset->model_number,
|
||||
'status_label' => $asset->assetstatus->name,
|
||||
'status_label' => ($asset->assetstatus) ? $asset->assetstatus->name : '',
|
||||
'last_checkout' => $asset->last_checkout,
|
||||
'category' => $asset->model->category->name,
|
||||
'category' => ($asset->model->category) ? $asset->model->category->name : '',
|
||||
'manufacturer' => $asset->manufacturer,
|
||||
'notes' => $asset->notes,
|
||||
'expected_checkin' => $asset->expected_checkin,
|
||||
|
|
Loading…
Reference in a new issue