mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
Check for valid model before attempting to access fieldsets
Fixes [ch1249]
This commit is contained in:
parent
fcbc7e4540
commit
1472e9d5b5
|
@ -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')) {
|
||||
|
|
Loading…
Reference in a new issue