From 2dca2d14c0c910c284b804e659d61aca75cb1c39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 12 Aug 2019 12:20:52 +0200 Subject: [PATCH] Use empty list with invalid field has not widget When setting the cursor, the invalid field may not have any widget on the current form. issue8559 review265761002 --- src/view/form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/view/form.js b/src/view/form.js index 8cd128bd0b..d990537a9f 100644 --- a/src/view/form.js +++ b/src/view/form.js @@ -373,7 +373,7 @@ function eval_pyson(value){ var error_els = this.el.find('.has-error'); var invalid_fields = record.invalid_fields(); for (name in invalid_fields) { - widgets = this.widgets[name]; + widgets = this.widgets[name] || []; for (i = 0; i < error_els.length; i++) { error_el = jQuery(error_els[i]); for (j = 0; j < widgets.length; j++) {