From 311de90579e3f61a294f0922413cd8553ebe46d8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 22 Sep 2020 22:49:50 +0200 Subject: [PATCH] make sure the theme exists --- apps/remix-ide/src/app/tabs/theme-module.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/tabs/theme-module.js b/apps/remix-ide/src/app/tabs/theme-module.js index fe63827303..d9de63ec5f 100644 --- a/apps/remix-ide/src/app/tabs/theme-module.js +++ b/apps/remix-ide/src/app/tabs/theme-module.js @@ -35,7 +35,8 @@ export class ThemeModule extends Plugin { } this.themes = themes.reduce((acc, theme) => ({ ...acc, [theme.name]: theme }), {}) const theme = (new QueryParams()).get().theme - this.active = theme || this._deps.config.get('settings/theme') || 'Dark' + const currentSetting = this._deps.config.get('settings/theme') + this.active = theme || (currentSetting && this.themes[currentSetting]) || 'Dark' this.forced = theme !== undefined }