Skip to content

Commit 21da1db

Browse files
authored
Merge pull request #727 from CodinGame/lmn/fix-register-css
Do not crash if importing css returns undefined
2 parents 7e734bd + f1ef382 commit 21da1db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/css.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { mainWindow } from 'vs/base/browser/window'
22

33
const sheets: CSSStyleSheet[] = []
44

5-
export function registerCss(module: unknown) {
6-
const exportedValue = (module as { default?: string | CSSStyleSheet }).default
5+
export function registerCss(module: { default?: string | CSSStyleSheet } | undefined) {
6+
const exportedValue = module?.default
77

88
let sheet = undefined
99
if (typeof exportedValue === 'string') {

0 commit comments

Comments
 (0)