Skip to content

Commit f1ef382

Browse files
author
Loïc Mangeonjean
committed
fix: do not crash if importing css returns undefined
1 parent 7e734bd commit f1ef382

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)