mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -08:00
Merge pull request #14107 from snipe/bug/sc-24471
Check that the asset exists before trying to get properties
This commit is contained in:
commit
4f8defb67d
|
@ -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