From b010d6a5d3ff152dfa2935b9f89adfbbd9c58dc3 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Wed, 3 May 2023 09:27:30 +0100 Subject: [PATCH] Handle unset editor theme (#12892) GitOrigin-RevId: 0e3413c08c6fd0752cd90ee868fec9b0f9f77437 --- .../frontend/js/features/source-editor/extensions/theme.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/web/frontend/js/features/source-editor/extensions/theme.ts b/services/web/frontend/js/features/source-editor/extensions/theme.ts index 2039aff297..0d4cf4a493 100644 --- a/services/web/frontend/js/features/source-editor/extensions/theme.ts +++ b/services/web/frontend/js/features/source-editor/extensions/theme.ts @@ -243,6 +243,10 @@ const staticTheme = EditorView.theme({ }) const loadSelectedTheme = async (editorTheme: string) => { + if (!editorTheme) { + editorTheme = 'textmate' // use the default theme if unset + } + const { theme, highlightStyle, dark } = await import( /* webpackChunkName: "cm6-theme" */ `../themes/cm6/${editorTheme}.json` )