From 7407366f454b855bd2f75bb92b2c962485d37527 Mon Sep 17 00:00:00 2001 From: Jakob Scheid Date: Thu, 4 Jun 2026 15:19:12 +0200 Subject: [PATCH] fix(settings): check the selection options and allowMultiple before and not after the default check in the settings validator --- src/features/settings/utils/settingsValidator.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/features/settings/utils/settingsValidator.js b/src/features/settings/utils/settingsValidator.js index 1f670a7..8afc467 100644 --- a/src/features/settings/utils/settingsValidator.js +++ b/src/features/settings/utils/settingsValidator.js @@ -55,7 +55,13 @@ export const validateEntry = function validateEntry (entry, path) { ); return; } - + + if (entry.type === 'selection') { + validateSelectionOptions(entry.options, path); + if (typeof entry.allowMultiple !== 'boolean' && entry.allowMultiple) { + throw new Error(`[settings] "${path}.allowMultiple" must be a boolean`); + } + }; if (entry.default !== undefined) { if (entry.type === 'bool' && typeof entry.default !== 'boolean') { throw new Error(`[settings] "${path}.default" must be a boolean`); @@ -67,12 +73,6 @@ export const validateEntry = function validateEntry (entry, path) { throw new Error(`[settings] "${path}.default" must be a string`); } } - if (entry.type === 'selection') { - validateSelectionOptions(entry.options, path); - if (typeof entry.allowMultiple !== 'boolean' && entry.allowMultiple) { - throw new Error(`[settings] "${path}.allowMultiple" must be a boolean`); - } - } } /**