mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08: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
|
// Validation for these fields is handled through the AssetRequest form request
|
||||||
$model = AssetModel::find($request->get('model_id'));
|
$model = AssetModel::find($request->get('model_id'));
|
||||||
|
|
||||||
if ($model->fieldset) {
|
if (($model) && ($model->fieldset)) {
|
||||||
foreach ($model->fieldset->fields as $field) {
|
foreach ($model->fieldset->fields as $field) {
|
||||||
if ($field->field_encrypted=='1') {
|
if ($field->field_encrypted=='1') {
|
||||||
if (Gate::allows('admin')) {
|
if (Gate::allows('admin')) {
|
||||||
|
|
Loading…
Reference in a new issue