diff --git a/packages/filesystem/src/browser/file-dialog/file-dialog-service.ts b/packages/filesystem/src/browser/file-dialog/file-dialog-service.ts index 5e43edcc55f83..5a0d15045fb7f 100644 --- a/packages/filesystem/src/browser/file-dialog/file-dialog-service.ts +++ b/packages/filesystem/src/browser/file-dialog/file-dialog-service.ts @@ -79,7 +79,8 @@ export class DefaultFileDialogService implements FileDialogService { } protected async getRootNode(folderToOpen?: FileStat): Promise { - const folder = folderToOpen || { + const folderExists = folderToOpen && await this.fileService.exists(folderToOpen.resource); + const folder = folderToOpen && folderExists ? folderToOpen : { resource: new URI(await this.environments.getHomeDirUri()), isDirectory: true };