diff --git a/packages/core/src/shared/settings.ts b/packages/core/src/shared/settings.ts index 71a2f83a77c..4e3e99f8207 100644 --- a/packages/core/src/shared/settings.ts +++ b/packages/core/src/shared/settings.ts @@ -389,6 +389,10 @@ function createSettingsClass(section: string, descript public _getOrThrow(key: K & string, defaultValue?: Inner[K]) { const value = this.#config.get(key, defaultValue) + if (defaultValue !== undefined && (value === undefined || value === null)) { + return defaultValue + } + return cast(value, descriptor[key]) }