Skip to content

Commit b4a2ab5

Browse files
committed
Avoid null-dereference of _languageServer in OnDebuggerStop handler
This primarily occured during unit testing, where the language server is not instantiated. Note that elsewhere in this file it is treated similarly.
1 parent ad28c88 commit b4a2ab5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PowerShellEditorServices/Services/PowerShellContext/PowerShellContextService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2392,7 +2392,7 @@ private void OnDebuggerStop(object sender, DebuggerStopEventArgs e)
23922392

23932393
if (!IsDebugServerActive)
23942394
{
2395-
_languageServer.SendNotification("powerShell/startDebugger");
2395+
_languageServer?.SendNotification("powerShell/startDebugger");
23962396
}
23972397

23982398
// We've hit a breakpoint so go to a new line so that the prompt can be rendered.

0 commit comments

Comments
 (0)