From 136fd53109d29f79cc8cdaff14466cef489b94c3 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Thu, 13 Feb 2020 16:48:39 -0600 Subject: [PATCH] Improve error handling on invalid model attributes being used for form fields --- modules/backend/widgets/Form.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/backend/widgets/Form.php b/modules/backend/widgets/Form.php index e7028c501..9238bb25e 100644 --- a/modules/backend/widgets/Form.php +++ b/modules/backend/widgets/Form.php @@ -1294,6 +1294,9 @@ class Form extends WidgetBase if (!is_array($fieldOptions) && !$fieldOptions) { try { list($model, $attribute) = $field->resolveModelAttribute($this->model, $field->fieldName); + if (!$model) { + throw new Exception(); + } } catch (Exception $ex) { throw new ApplicationException(Lang::get('backend::lang.field.options_method_invalid_model', [