Fix Exit-PSHostProcess cmdlet crash issue

This commit is contained in:
George Fleming
2015-11-12 13:20:25 -08:00
parent e4d598d2d2
commit fd4cce4ce1
+1 -1
View File
@@ -417,7 +417,7 @@ namespace Microsoft.Samples.PowerShell.Host
// Read commands and run them until the ShouldExit flag is set by
// the user calling "exit".
while (!this.ShouldExit)
while (!this.ShouldExit && this.myHost.Runspace != null)
{
string prompt = Prompt(this.myHost.Runspace);