Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit e906f1a

Browse files
author
Marcel Gerber
committed
Handle undefined theme the right way
1 parent e3bf0fa commit e906f1a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/view/ThemeManager.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,8 @@ define(function (require, exports, module) {
266266
var cm = editor._codeMirror;
267267
ThemeView.updateThemes(cm);
268268

269-
// currentTheme can be undefined if you reloaded without extensions
270-
if (currentTheme && currentTheme.addModeClass !== undefined) {
271-
cm.setOption("addModeClass", currentTheme.addModeClass);
272-
}
269+
// currentTheme can be undefined, so watch out
270+
cm.setOption("addModeClass", !!(currentTheme && currentTheme.addModeClass));
273271
});
274272
}
275273

0 commit comments

Comments
 (0)