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

Null ref when attempting to assign null to value-type collections #31404

Closed
layomia opened this issue Nov 6, 2019 · 2 comments
Closed

Null ref when attempting to assign null to value-type collections #31404

layomia opened this issue Nov 6, 2019 · 2 comments
Assignees
Milestone

Comments

@layomia
Copy link
Contributor

layomia commented Nov 6, 2019

An example is ImmutableArray which is a struct. Discovered when fixing https://github.com/dotnet/corefx/issues/41598.

Should throw JsonException instead.

@layomia layomia self-assigned this Nov 6, 2019
@layomia
Copy link
Contributor Author

layomia commented Nov 13, 2019

There's also an issue with nullable value-type collections. From @ahsonkhan in dotnet/corefx#42420 (comment):

As an aside, looks like nullable ImmutableArray breaks:

Console.WriteLine(JsonSerializer.Deserialize<ImmutableArray<DateTime>?>("null") == null);
Unhandled exception. System.ArgumentNullException: Value cannot be null.
   at System.RuntimeType.MakeGenericType(Type[] instantiation)

@layomia
Copy link
Contributor Author

layomia commented Dec 19, 2019

Closing as duplicate of #1037.

@layomia layomia closed this as completed Dec 19, 2019
@msftgits msftgits transferred this issue from dotnet/corefx Feb 1, 2020
@msftgits msftgits added this to the 5.0 milestone Feb 1, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants