FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix the null-reference exception when running `Debug-Job` on a thread job by daxian-dbw · Pull Request #3957 · PowerShell/PSReadLine · GitHub

Fix the null-reference exception when running Debug-Job on a thread job - #3957

Merged
Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
daxian-dbw:null-ex
Feb 26, 2024
Merged

Fix the null-reference exception when running Debug-Job on a thread job#3957
Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
daxian-dbw:null-ex

Conversation

Dongbo Wang (daxian-dbw) commented Feb 26, 2024
edited by microsoft-github-policy-service Bot
Loading

Copy link
Copy Markdown
Member

PR Summary

Fix #3954

The $Host.Runspace is null when PSConsoleHostReadLine is invoked while debugging a thread job.
This is because a thread job uses the default host, which always has value null for $Host.Runspace.
We set the current path to be null when either runspace or engineIntrinsics is null.

PR Checklist

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Make sure you've added one or more new tests
  • Make sure you've tested these changes in terminals that PowerShell is commonly used in (i.e. conhost.exe, Windows Terminal, Visual Studio Code Integrated Terminal, etc.)
  • User-facing changes
    • Not Applicable
    • OR
    • Documentation needed at PowerShell-Docs
      • Doc Issue filed:
Microsoft Reviewers: Open in CodeFlow

Comment thread PSReadLine/Prediction.cs
Dongbo Wang (daxian-dbw) merged commit ce2302c into PowerShell:master Feb 26, 2024
Dongbo Wang (daxian-dbw) added Backport-2.3.x-Consider To be backported to v2.3.x. Backport-2.3.x-Done Finished cherry-picking the commit to the release branch. and removed Backport-2.3.x-Consider To be backported to v2.3.x. labels Apr 2, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-2.3.x-Done Finished cherry-picking the commit to the release branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using Debug-Job to debug a background / thread job causes a crash

2 participants


Back | FazBrowse Home | New Git URL