From 5478bd938ef9c871b43f776074f19b275baf1c62 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 13 Mar 2018 17:40:06 +0530 Subject: [PATCH] Fix #45549 --- src/vs/workbench/browser/parts/views/customView.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/browser/parts/views/customView.ts b/src/vs/workbench/browser/parts/views/customView.ts index 4cad51aec58ce..66f4b10dd650a 100644 --- a/src/vs/workbench/browser/parts/views/customView.ts +++ b/src/vs/workbench/browser/parts/views/customView.ts @@ -133,7 +133,7 @@ class CustomTreeViewer extends Disposable implements ITreeViewer { onDidChange = dataProvider.onDidChange; onDispose = dataProvider.onDispose; getChildren(node?: ITreeItem): TPromise { - if (node.children) { + if (node && node.children) { return TPromise.as(node.children); } const promise = node instanceof Root ? dataProvider.getChildren() : dataProvider.getChildren(node); @@ -464,7 +464,7 @@ class Aligner extends Disposable { if (this.hasIcon(parent)) { return false; } - return parent.children.every(c => c.collapsibleState === TreeItemCollapsibleState.None || !this.hasIcon(c)); + return parent.children && parent.children.every(c => c.collapsibleState === TreeItemCollapsibleState.None || !this.hasIcon(c)); } private hasIcon(node: ITreeItem): boolean {