From 1472e9d5b5330d34e5e66a7db2971fc5e8a50b7e Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 24 May 2019 15:03:15 -0700 Subject: [PATCH] Check for valid model before attempting to access fieldsets Fixes [ch1249] --- app/Http/Controllers/AssetsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php index 35425883c3..8f3182ec33 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -380,7 +380,7 @@ class AssetsController extends Controller // FIXME: No idea why this is returning a Builder error on db_column_name. // Need to investigate and fix. Using static method for now. $model = AssetModel::find($request->get('model_id')); - if ($model->fieldset) { + if (($model) && ($model->fieldset)) { foreach ($model->fieldset->fields as $field) { if ($field->field_encrypted=='1') { if (Gate::allows('admin')) {