aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/json-schema.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-09-11 14:15:08 -0400
committerGitHub <noreply@github.com>2020-09-11 14:15:08 -0400
commitf168efb69c0387da0be4e9f2807fd9074992346f (patch)
tree102d68d73e5914848b3d795238f9478dd79bd7b9 /ext/bg/js/json-schema.js
parenta1729eb9aee9426cc9b543c865a53e843ae5f487 (diff)
OptionsUtil refactor / options default values (#807)
* Replace _readFile with _fetchAsset for consistency with Backend * Fix error messages * Make OptionsUtil non-static * Update how default options are assigned * Add createValidatingProxy * Add validate, update _onApiSetAllSettings * Remove unused api.optionsSchemaGet * Remove Backend._optionsSchema * Update OptionsUtil to create its own JsonSchemaValidator * Rename Backend._optionsSchemaValidator * Make getDefault non-async
Diffstat (limited to 'ext/bg/js/json-schema.js')
-rw-r--r--ext/bg/js/json-schema.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/bg/js/json-schema.js b/ext/bg/js/json-schema.js
index 1be78fd2..cdfd339f 100644
--- a/ext/bg/js/json-schema.js
+++ b/ext/bg/js/json-schema.js
@@ -149,7 +149,7 @@ class JsonSchemaValidator {
getValidValueOrDefault(schema, value) {
let type = this._getValueType(value);
const schemaType = schema.type;
- if (!this._isValueTypeAny(value, type, schemaType)) {
+ if (typeof value === 'undefined' || !this._isValueTypeAny(value, type, schemaType)) {
let assignDefault = true;
const schemaDefault = schema.default;