Use optional chaining

This commit is contained in:
Miguel Solorio
2019-11-13 23:04:09 -08:00
parent a0316e3b30
commit bf9d2637b8
2 changed files with 2 additions and 2 deletions

View File

@@ -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;