mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Check that the asset exists before trying to get properties
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
6ebbd2dc30
commit
2707c399ea
|
@ -45,7 +45,7 @@ class AssetMaintenancesTransformer
|
|||
'name'=> e($assetmaintenance->asset->location->name),
|
||||
|
||||
] : null,
|
||||
'rtd_location' => ($assetmaintenance->asset->defaultLoc) ? [
|
||||
'rtd_location' => (($assetmaintenance->asset) && ($assetmaintenance->asset->defaultLoc)) ? [
|
||||
'id' => (int) $assetmaintenance->asset->defaultLoc->id,
|
||||
'name'=> e($assetmaintenance->asset->defaultLoc->name),
|
||||
] : null,
|
||||
|
|
Loading…
Reference in a new issue