From 617b22887603c92dddb793bbc21b102fd2021902 Mon Sep 17 00:00:00 2001 From: Robert Holt Date: Tue, 21 May 2019 14:04:04 -0700 Subject: [PATCH] Add check for workspace path --- src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs b/src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs index 41dfb4181..d582a7084 100644 --- a/src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs +++ b/src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs @@ -226,7 +226,8 @@ protected async Task HandleInitializeRequest( editorSession.Workspace.WorkspacePath = initializeParams.RootPath; // Set the working directory of the PowerShell session to the workspace path - if (editorSession.Workspace.WorkspacePath != null) + if (editorSession.Workspace.WorkspacePath != null + && Directory.Exists(editorSession.Workspace.WorkspacePath)) { await editorSession.PowerShellContext.SetWorkingDirectory( editorSession.Workspace.WorkspacePath,