mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Use optional chaining
This commit is contained in:
@@ -1096,7 +1096,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||
private createTouchBarGroupSegments(items: ISerializableCommandAction[] = []): ITouchBarSegment[] {
|
||||
const segments: ITouchBarSegment[] = items.map(item => {
|
||||
let icon: NativeImage | undefined;
|
||||
if (item.iconLocation && typeof item.iconLocation?.dark !== 'undefined' && item.iconLocation.dark.scheme === 'file') {
|
||||
if (item.iconLocation && item.iconLocation?.dark?.scheme === 'file') {
|
||||
icon = nativeImage.createFromPath(URI.revive(item.iconLocation.dark).fsPath);
|
||||
if (icon.isEmpty()) {
|
||||
icon = undefined;
|
||||
|
||||
Reference in New Issue
Block a user