Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix NullDereferenceException in Add-PnPField #2338

Merged
merged 1 commit into from
Sep 12, 2022

Conversation

jackpoz
Copy link
Contributor

@jackpoz jackpoz commented Sep 11, 2022

Fix NullDereferenceException in Add-PnPField when not including -Type parameter and specifying Choice, MultiChoice or Calculated as Type later on

Before creating a pull request, make sure that you have read the contribution file located at

https://github.com/pnp/powerShell/blob/dev/CONTRIBUTING.md

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

No linked issues

What is in this Pull Request ?

Similar to #2156 and New-PnPSite, this PR fixes NullDereferenceExceptions thrown when calling Add-PnPField without specifying -Type parameter but later selecting a Type that requires dynamic parameters.

The affected -Type options are:

  • Choice
  • MultiChoice
  • Calculated

Tests

Old behavior:
image

New behavior:
image

Test passing -Type:
image

Test without passing -Type but specifying Text:
image

Fix NullDereferenceException in Add-PnPField when not including -Type parameter and specifying Choice, MultiChoice or Calculated as Type later on
@gautamdsheth gautamdsheth merged commit 17e280e into pnp:dev Sep 12, 2022
@gautamdsheth
Copy link
Collaborator

Thanks @jackpoz for fixing this, have merged this.

@jackpoz jackpoz deleted the fixes/AddFieldException branch December 4, 2022 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants