From cf8feb37e112c5e3124101652a8984843fbb179a Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 25 Jan 2018 03:00:54 -0800 Subject: [PATCH] Fixed crash if no model associated This should never be triggered. Bad data is getting in somehow. --- app/Http/Transformers/AssetsTransformer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Transformers/AssetsTransformer.php b/app/Http/Transformers/AssetsTransformer.php index 611f8ec3d5..3877f7bc2e 100644 --- a/app/Http/Transformers/AssetsTransformer.php +++ b/app/Http/Transformers/AssetsTransformer.php @@ -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) {