From bfe2caaa809be2ae12eaa2a7caa50f27b33e144b Mon Sep 17 00:00:00 2001 From: Jackson Kearl Date: Tue, 14 Sep 2021 11:06:03 -0700 Subject: [PATCH] Fix microsoft/vscode-dev/issues/238 --- src/vs/workbench/contrib/files/browser/views/explorerView.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/files/browser/views/explorerView.ts b/src/vs/workbench/contrib/files/browser/views/explorerView.ts index ca03f5505a8..f8cc1b7a928 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerView.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerView.ts @@ -641,8 +641,8 @@ export class ExplorerView extends ViewPane { const previousInput = this.tree.getInput(); const promise = this.tree.setInput(input, viewState).then(async () => { if (Array.isArray(input)) { - if (!viewState || previousInput instanceof ExplorerItem) { - // There is no view state for this workspace, expand all roots. Or we transitioned from a folder workspace. + if (!viewState || previousInput instanceof ExplorerItem || !previousInput) { + // There is no view state for this workspace, expand all roots. Or we transitioned from a folder/empty workspace. await Promise.all(input.map(async item => { try { await this.tree.expand(item);