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

Fix crash if command sent to pwsh is just whitespace by SteveL-MSFT · Pull Request #10977 · PowerShell/PowerShell · GitHub

Fix crash if command sent to pwsh is just whitespace - #10977

Merged
Andrew (anmenaga) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:pwsh-whitespace-arg
Nov 4, 2019
Merged

Fix crash if command sent to pwsh is just whitespace#10977
Andrew (anmenaga) merged 2 commits into
PowerShell:masterfrom
SteveL-MSFT:pwsh-whitespace-arg

Conversation

Steve Lee (SteveL-MSFT) commented Nov 2, 2019
edited
Loading

Copy link
Copy Markdown
Member

PR Summary

In the early parsing code, a null switchkey can be returned. This isn't expected in later code resulting in an unhandled exception. Fix is to check if switchkey is null before additoinal processing. In this case, just whitespace is sent to PowerShell whereas an empty string returns an error.

PR Context

Fix #10975

PR Checklist

Dongbo Wang (daxian-dbw) left a comment

Copy link
Copy Markdown
Member

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

LGTM

Andrew (anmenaga) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Nov 4, 2019
Andrew (anmenaga) added this to the 7.0.0-preview.6 milestone Nov 4, 2019
Andrew (anmenaga) merged commit baf2410 into PowerShell:master Nov 4, 2019

Copy link
Copy Markdown

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

Handy links:

Steve Lee (SteveL-MSFT) deleted the pwsh-whitespace-arg branch June 6, 2020 02:29
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

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.

PowerShell can't handle empty commandline parameter

5 participants


Back | FazBrowse Home | New Git URL