mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 07:34:06 -08:00
Handled bad model id
This commit is contained in:
parent
41b864cc49
commit
a283b13069
|
@ -291,8 +291,7 @@ class AssetsController extends Controller
|
|||
$asset->company_id = Company::getIdForCurrentUser($request->get('company_id')) : '';
|
||||
|
||||
if ($request->has('model_id')) {
|
||||
$model = AssetModel::find($request->get('model_id'));
|
||||
if ($model->fieldset) {
|
||||
if ($model = AssetModel::find($request->get('model_id'))) {
|
||||
foreach ($model->fieldset->fields as $field) {
|
||||
if ($request->has(CustomField::name_to_db_name($field->name))) {
|
||||
$asset->{CustomField::name_to_db_name($field->name)} = e($request->input(CustomField::name_to_db_name($field->name)));
|
||||
|
|
Loading…
Reference in a new issue