Ensure testing descriptor property of Array object

Object.getOwnPropertyDescriptor fails if the value is undefined and the method
can return null if there is no such property.
So we must ensure that the value is a Group (which means an Array).

issue8136
review53561002
This commit is contained in:
Cédric Krier committed 2019-02-25 19:30:05 +01:00
1 parent d5c186f9bf
commit e430058e28
1 file changed
+4 -1
+4 -1
View File
@@ -1256,9 +1256,12 @@
}
var field = this.model.fields[name];
var value = this._values[name];
if (!(value instanceof Array)) {
continue;
}
var context_descriptor = Object.getOwnPropertyDescriptor(
value, 'context');
if (!value || !context_descriptor.set) {
if (!context_descriptor || !context_descriptor.set) {
continue;
}
var context = field.description.context;