From e430058e28330c97d2f0cd3b2547ff7e64f51541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 25 Feb 2019 19:30:05 +0100 Subject: [PATCH] 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 --- src/model.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/model.js b/src/model.js index a659738051..f46c452c9a 100644 --- a/src/model.js +++ b/src/model.js @@ -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;