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

FastObservableDictionary should allow null-values and not throw ArgumentNullException #1691

Closed
2 of 6 tasks
xaevik opened this issue Nov 3, 2020 · 4 comments
Closed
2 of 6 tasks
Assignees
Milestone

Comments

@xaevik
Copy link

xaevik commented Nov 3, 2020

IF YOU DON'T ANSWER THIS TEMPLATE - THE BOT WILL AUTOMATICALLY CLOSE YOUR ISSUE!

Please check all of the platforms you are having the issue on (if platform is not listed, it is not supported)

  • WPF
  • UWP
  • iOS
  • Android
  • .NET Standard
  • .NET Core

Component

Catel.Collections.FastObservableDictionary

Version of Library

5.12.10

Version of OS(s) listed above with issue

Windows 10 20H2

Steps to Reproduce

  1. Create a new FastObservableDictionary<> collection that supports nullable values (e.g. string)
  2. Attempt to add an item to the collection with a null value (e.g. dict.Add("key1", null);)

Expected Behavior

The item key1 with a value of null should add to the collection

Actual Behavior

The exception ArgumentNullException is thrown because newValue is null. The behavior of FastObservableDictionary should follow the pattern of all derivatives of Dictionary in that only the key is not allowed to be null. It should be up to the caller/implementer to restrict that behavior.

I unfortunately do not have the bandwidth to absorb this right now.

@GeertvanHorrik
Copy link
Member

Thanks for reporting. I will try to fix this in 6.0 and if we create a new hotfix, this will be included as well.

@GeertvanHorrik GeertvanHorrik self-assigned this Nov 3, 2020
@GeertvanHorrik GeertvanHorrik added bug and removed bug labels Nov 3, 2020
@GeertvanHorrik GeertvanHorrik added this to the 6.0.0 milestone Nov 3, 2020
@GeertvanHorrik GeertvanHorrik modified the milestones: 6.0.0, 5.12.11 Nov 20, 2020
@GeertvanHorrik
Copy link
Member

We are probably going to create a hotfix for #1712 , so will include this.

@GeertvanHorrik
Copy link
Member

Adding unit tests.

@GeertvanHorrik GeertvanHorrik changed the title FastObservableDictionary Throws ArgumentNullException for Values FastObservableDictionary should allow null-values and not throw ArgumentNullException Nov 20, 2020
GeertvanHorrik added a commit that referenced this issue Nov 20, 2020
@GeertvanHorrik
Copy link
Member

done.

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

No branches or pull requests

2 participants