mirror of
https://github.com/snipe/snipe-it.git
synced 2024-09-20 07:47:41 -07:00
Check that a model exists before trying to fiddle with fieldsets
This commit is contained in:
parent
aa0b627fe7
commit
d4725b61be
|
@ -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')) {
|
||||
|
|
Loading…
Reference in a new issue