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

[BUG] Set-PnPTeamsChannel: IsFavoriteByDefault 'Nullable object must have a value.' #2424

Closed
1 of 6 tasks
RobLempens opened this issue Oct 5, 2022 · 0 comments · Fixed by #2425
Closed
1 of 6 tasks
Labels
bug Something isn't working

Comments

@RobLempens
Copy link
Contributor

Reporting an Issue or Missing Feature

If “Automatically show this channel in everyone’s channel list” (or in code “IsFavoriteByDefault”) is set to true, it is also saved as true but when it is set to false, NULL is saved.

When this “IsFavoriteByDefault” is NULL and the Set-PnPTeamsChannel function is triggered the execution of the commandlet will fail with a 'Nullable object must have a value.' Error.

Expected behavior

Updating the teams channel by calling the Set-PnPTeamsChannel function.

Actual behavior

'Nullable object must have a value.' Error.

Steps to reproduce behavior

Set the “IsFavoriteByDefault” to false (UI, MS Graph or PS) (NULL will be saved).
After this, the property is set to NULL.
When the Set-PnPTeamsChannel function is called again it will fail with a 'Nullable object must have a value.' Error.
This happens because “teamChannel.IsFavoriteByDefault” is NULL and the following code is called: “teamChannel.IsFavoriteByDefault.Value”

What is the version of the Cmdlet module you are running?

1.11.0

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
@RobLempens RobLempens added the bug Something isn't working label Oct 5, 2022
RobLempens added a commit to RobLempens/powershell that referenced this issue Oct 5, 2022
KoenZomers added a commit that referenced this issue Oct 6, 2022
Set-PnPTeamsChannel: IsFavoriteByDefault 'Nullable object error  (#2424)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant