Skip to content

Commit d48d650

Browse files
authored
Exception when expanding node (#7456)
Fixes #7453
1 parent 3fea6c5 commit d48d650

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/view/theme.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export async function loadCurrentThemeData(): Promise<ThemeData> {
2020

2121
export interface ThemeData {
2222
type: string,
23-
colors: { [key: string]: string }
23+
colors?: { [key: string]: string }
2424
tokenColors: any[],
2525
semanticTokenColors: any[]
2626
}
@@ -72,17 +72,17 @@ function getCurrentThemePaths(themeName: string): vscode.Uri | undefined {
7272
}
7373

7474
export function getIconForeground(themeData: ThemeData, kind: 'light' | 'dark'): string {
75-
return themeData.colors['icon.foreground'] ?? (kind === 'dark' ? '#C5C5C5' : '#424242');
75+
return (themeData.colors ? themeData.colors['icon.foreground'] : undefined) ?? (kind === 'dark' ? '#C5C5C5' : '#424242');
7676
}
7777

7878
export function getListWarningForeground(themeData: ThemeData, kind: 'light' | 'dark'): string {
79-
return themeData.colors['list.warningForeground'] ?? (kind === 'dark' ? '#CCA700' : '#855F00');
79+
return (themeData.colors ? themeData.colors['list.warningForeground'] : undefined) ?? (kind === 'dark' ? '#CCA700' : '#855F00');
8080
}
8181

8282
export function getListErrorForeground(themeData: ThemeData, kind: 'light' | 'dark'): string {
83-
return themeData.colors['list.errorForeground'] ?? (kind === 'dark' ? '#F88070' : '#B01011');
83+
return (themeData.colors ? themeData.colors['list.errorForeground'] : undefined) ?? (kind === 'dark' ? '#F88070' : '#B01011');
8484
}
8585

8686
export function getNotebookStatusSuccessIconForeground(themeData: ThemeData, kind: 'light' | 'dark'): string {
87-
return themeData.colors['notebookStatusSuccessIcon.foreground'] ?? (kind === 'dark' ? '#89D185' : '#388A34');
87+
return (themeData.colors ? themeData.colors['notebookStatusSuccessIcon.foreground'] : undefined) ?? (kind === 'dark' ? '#89D185' : '#388A34');
8888
}

0 commit comments

Comments
 (0)