diff --git a/src/model/ui/ui-store.ts b/src/model/ui/ui-store.ts index b7d67faf..557c85cb 100644 --- a/src/model/ui/ui-store.ts +++ b/src/model/ui/ui-store.ts @@ -157,7 +157,12 @@ export class UiStore { if (!themeData) throw new Error("Could not parse theme JSON"); if (!themeData.name) throw new Error('Theme must contain a `name` field'); - if (!themeData.extends) throw new Error('Theme must contain an `extends` field with a built-in theme name (dark/light/high-contrast)'); + if ( + !themeData.extends || + Themes[themeData.extends as ThemeName] === undefined + ) { + throw new Error('Theme must contain an `extends` field with a built-in theme name (dark/light/high-contrast)'); + } const baseTheme = Themes[themeData.extends]; return {