Skip to content

Fix parsing of empty hashtable when string is provided as settings object #1073

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Conversation

bergmeister
Copy link
Collaborator

PR Summary

Fixes #1063 whereby parsing the settings hashtable fails when it is being provided as a string due to a helper method returning null instead of an empty list.

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets. Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • User facing documentation needed
  • Change is not breaking
  • Make sure you've added a new test if existing tests do not effectively test the code changed
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

Copy link
Contributor

@JamesWTruher JamesWTruher left a comment

Choose a reason for hiding this comment

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

👍

@JamesWTruher
Copy link
Contributor

it's curious, a malformed file will still be accepted, I created a file:

@{ ExcludeRules = @()

not sure what to do about it though

@bergmeister
Copy link
Collaborator Author

@JamesWTruher This is due to issue #1053. Using the -Verbose switch, one can at least get the information out that parsing failed but it is basically a problem of the initial design that should be fixed with a separate refactoring (that would be more involved)

@JamesWTruher JamesWTruher merged commit 0d81244 into PowerShell:development Oct 3, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when using Settings have ExcludeRules = @()
2 participants