Fixed crash if no model associated

This should never be triggered. Bad data is getting in somehow.
This commit is contained in:
snipe 2018-01-25 03:00:54 -08:00
parent 11505d5d06
commit cf8feb37e1

View file

@ -81,7 +81,7 @@ class AssetsTransformer
];
if (($asset->model->fieldset) && (count($asset->model->fieldset->fields)> 0)) {
if (($asset->model) && ($asset->model->fieldset) && (count($asset->model->fieldset->fields)> 0)) {
$fields_array = array();
foreach ($asset->model->fieldset->fields as $field) {