From b1fc9c024ae84ed603d7f7bec54fadc73a39f1b8 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 2 Feb 2020 11:13:26 -0500 Subject: [PATCH] Update how property schemas are returned --- ext/bg/js/json-schema.js | 10 +++++++--- 1 file 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; + } } }