Skip to content

Commit e515a07

Browse files
Robert HoltTylerLeonhardt
Robert Holt
authored andcommitted
Add check for workspace path (#956)
1 parent 9eadcb7 commit e515a07

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ protected async Task HandleInitializeRequest(
226226
editorSession.Workspace.WorkspacePath = initializeParams.RootPath;
227227

228228
// Set the working directory of the PowerShell session to the workspace path
229-
if (editorSession.Workspace.WorkspacePath != null)
229+
if (editorSession.Workspace.WorkspacePath != null
230+
&& Directory.Exists(editorSession.Workspace.WorkspacePath))
230231
{
231232
await editorSession.PowerShellContext.SetWorkingDirectory(
232233
editorSession.Workspace.WorkspacePath,

0 commit comments

Comments
 (0)