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

Fix null reference exception in ForEach-Object -Parallel input processing by PaulHigin · Pull Request #10577 · PowerShell/PowerShell · GitHub

Fix null reference exception in ForEach-Object -Parallel input processing - #10577

Merged
Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
PaulHigin:fix-foreach-parallel-bug1
Sep 20, 2019
Merged

Fix null reference exception in ForEach-Object -Parallel input processing#10577
Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
PaulHigin:fix-foreach-parallel-bug1

Conversation

Copy link
Copy Markdown
Contributor

PR Summary

Fixes a null reference exception in the ForEach-Object -Parallel experimental feature.

PR Context

Piped input can be null, but a type check in parallel processing was not accounting for it. The result was a null reference exception.

Fix is to add a null check.

PR Checklist

Ilya (iSazonov) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Sep 20, 2019
Ilya (iSazonov) added this to the 7.0.0-preview.5 milestone Sep 20, 2019
// Validate piped InputObject
if (_inputObject.BaseObject is ScriptBlock)
if (_inputObject != null &&
_inputObject.BaseObject is ScriptBlock)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The error message for null does not look correct.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

A null input object is valid, so there is no error for that. This check just prevents a null dereference when checking the input type.

Dongbo Wang (daxian-dbw) added the AutoMerge informs the bot to automerge the PR label Sep 20, 2019

Copy link
Copy Markdown

Hello Dongbo Wang (@daxian-dbw)!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 24 hours, a condition that will be fulfilled in about 30 minutes. No worries though, I will be back when the time is right! 😉

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

Dongbo Wang (daxian-dbw) merged commit ecad5f1 into PowerShell:master Sep 20, 2019
Paul Higinbotham (PaulHigin) deleted the fix-foreach-parallel-bug1 branch September 20, 2019 19:04

Copy link
Copy Markdown

🎉v7.0.0-preview.5 has been released which incorporates this pull request.:tada:

Handy links:

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj/PowerShell that referenced this pull request Aug 6, 2026
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

AutoMerge informs the bot to automerge the PR CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL