Skip to content

Commit 131de1d

Browse files
author
Kapil Borle
committed
Validate workspace path before enumerating PS files
1 parent 4625326 commit 131de1d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PowerShellEditorServices/Workspace/Workspace.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ public string GetRelativePath(string filePath)
219219
/// <returns>An enumerator over the PowerShell files found in the workspace</returns>
220220
public IEnumerable<string> EnumeratePSFiles()
221221
{
222-
if (WorkspacePath == null)
222+
if (WorkspacePath == null
223+
|| !Directory.Exists(WorkspacePath))
223224
{
224225
yield break;
225226
}

0 commit comments

Comments
 (0)