Skip to content

Commit 2db050d

Browse files
Handle debuggerResult being null in ProcessDebuggerResult (#1670)
Not entirely sure why this can be the case, but a stacktrace from a null dereference crash indicates it can be null. Since the existing logic is only doing something if the `ResumeAction` field is not null, I assume we similarly do nothing if the entire object is also null (since that implies the former, too).
1 parent 39d26ee commit 2db050d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public void SetDebuggerResumed()
151151

152152
public void ProcessDebuggerResult(DebuggerCommandResults debuggerResult)
153153
{
154-
if (debuggerResult.ResumeAction is not null)
154+
if (debuggerResult?.ResumeAction is not null)
155155
{
156156
SetDebugResuming(debuggerResult.ResumeAction.Value);
157157
RaiseDebuggerResumingEvent(new DebuggerResumingEventArgs(debuggerResult.ResumeAction.Value));

0 commit comments

Comments
 (0)