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
This commit is contained in:
Cédric Krier committed 2019-08-12 12:20:52 +02:00
1 parent f4410f15e2
commit 2dca2d14c0
1 file changed
+1 -1
+1 -1
View File
@@ -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++) {