aboutsummaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-02 11:13:26 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-02-02 11:13:26 -0500
commitb1fc9c024ae84ed603d7f7bec54fadc73a39f1b8 (patch)
tree5cdecce01760241b6702cb80250b75cd48614bdc /ext/bg
parentea808024d70e95b94dca7f846e7910573fed8466 (diff)
Update how property schemas are returned
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/json-schema.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/bg/js/json-schema.js b/ext/bg/js/json-schema.js
index 0ca1183e..8db5411c 100644
--- a/ext/bg/js/json-schema.js
+++ b/ext/bg/js/json-schema.js
@@ -126,8 +126,9 @@ class JsonSchemaProxyHandler {
{
const properties = schema.properties;
if (JsonSchemaProxyHandler.isObject(properties)) {
- if (Object.prototype.hasOwnProperty.call(properties, property)) {
- return properties[property];
+ const propertySchema = properties[property];
+ if (JsonSchemaProxyHandler.isObject(propertySchema)) {
+ return propertySchema;
}
}
@@ -148,7 +149,10 @@ class JsonSchemaProxyHandler {
}
if (Array.isArray(items)) {
if (property >= 0 && property < items.length) {
- return items[property];
+ const propertySchema = items[property];
+ if (JsonSchemaProxyHandler.isObject(propertySchema)) {
+ return propertySchema;
+ }
}
}