diff --git a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts index 1f2e0cb6e1f..4b00a047013 100644 --- a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts +++ b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts @@ -894,7 +894,7 @@ class StatusbarEntryItem extends Disposable { } private applyColor(container: HTMLElement, color: string | ThemeColor | undefined, isBackground?: boolean): void { - let colorResult: string | null = null; + let colorResult: string | undefined = undefined; if (isBackground) { this.backgroundListener.clear(); @@ -904,15 +904,15 @@ class StatusbarEntryItem extends Disposable { if (color) { if (isThemeColor(color)) { - colorResult = (this.themeService.getColorTheme().getColor(color.id) || Color.transparent).toString(); + colorResult = this.themeService.getColorTheme().getColor(color.id)?.toString(); const listener = this.themeService.onDidColorThemeChange(theme => { - const colorValue = (theme.getColor(color.id) || Color.transparent).toString(); + const colorValue = theme.getColor(color.id)?.toString(); if (isBackground) { - container.style.backgroundColor = colorValue; + container.style.backgroundColor = colorValue ?? ''; } else { - container.style.color = colorValue; + container.style.color = colorValue ?? ''; } }); @@ -927,9 +927,9 @@ class StatusbarEntryItem extends Disposable { } if (isBackground) { - container.style.backgroundColor = colorResult || ''; + container.style.backgroundColor = colorResult ?? ''; } else { - container.style.color = colorResult || ''; + container.style.color = colorResult ?? ''; } }