From d4725b61bed74c93e37064018bae735753cd2748 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 24 May 2019 04:48:04 -0700 Subject: [PATCH] Check that a model exists before trying to fiddle with fieldsets --- 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 f42634ed95..35425883c3 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -183,7 +183,7 @@ class AssetsController extends Controller // Validation for these fields is handled through the AssetRequest form request $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')) {