Skip to content

Commit fa7f647

Browse files
committed
Fix null dereference bug in RaiseDebuggerStoppedEvent()
1 parent 07a4241 commit fa7f647

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PowerShellEditorServices/Services/PowerShell/Debugging/PowerShellDebugContext.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ private void RaiseDebuggerStoppedEvent()
167167
{
168168
if (!IsDebugServerActive)
169169
{
170-
_languageServer.SendNotification("powerShell/startDebugger");
170+
// NOTE: The language server is not necessarily connected, so this must be
171+
// conditional access. This shows up in unit tests.
172+
_languageServer?.SendNotification("powerShell/startDebugger");
171173
}
172174

173175
DebuggerStopped?.Invoke(this, LastStopEventArgs);

0 commit comments

Comments
 (0)