Skip to content

Commit

Permalink
Fix the null-reference exception when running Debug-Job on a thread…
Browse files Browse the repository at this point in the history
… job (#3957)
  • Loading branch information
daxian-dbw committed Feb 26, 2024
1 parent d332e21 commit ce2302c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion PSReadLine/Prediction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ private static void UpdatePredictionClient(Runspace runspace, EngineIntrinsics e
if (s_pCurrentLocation is not null)
{
// Set the current location if it's a local Runspace. Otherwise, set it to null.
object path = runspace.RunspaceIsRemote ? null : engineIntrinsics.SessionState.Path.CurrentLocation;
object path = runspace is null || runspace.RunspaceIsRemote
? null
: engineIntrinsics?.SessionState.Path.CurrentLocation;
s_pCurrentLocation.SetValue(s_predictionClient, path);
}
}
Expand Down

0 comments on commit ce2302c

Please sign in to comment.