pulumi/sdk/dotnet/Pulumi/Serialization
Fraser Waters 27237354a7
Don't crash on null inputs for value types in IOutputCompletionSource.SetValue(OutputData<object?> data) (#8628)
* Don't crash on null inputs for value types in IOutputCompletionSource.SetValue(OutputData<object?> data)

SetValue correctly annotates that the object held in data might be null.
But then ignores that annotation and tries to cast to `T`, if the object
is null this is fine for reference types which just stay null, but for
value types this throws a NullReferenceException. Simple fix to just use
`default(T)` for when `data.Value` is null, and only cast when non-null.

This has the same behaviour as before for reference types (where
`default(T)` is null) but means that value types take their default
value rather than throwing.

Fixes #8625

* Update changelog
2021-12-23 10:54:48 +00:00
..
Attributes.cs [dotnet] Resource package registration in .NET (attributes) (#5875) 2020-12-09 23:28:58 +01:00
Constants.cs Enable output marshaling in .NET (#8316) 2021-11-12 14:58:34 -08:00
Converter.cs Don't throw on type mismatches in the dotnet sdk (#8286) 2021-10-29 17:35:17 +01:00
Deserializer.cs Enable output marshaling in .NET (#8316) 2021-11-12 14:58:34 -08:00
ImmutableDictionaryExtensions.cs Fix 8322 (#8339) 2021-11-08 10:45:26 -05:00
OutputCompletionSource.cs Don't crash on null inputs for value types in IOutputCompletionSource.SetValue(OutputData<object?> data) (#8628) 2021-12-23 10:54:48 +00:00
OutputData.cs [dotnet] Fix Resharper code issues (#7178) 2021-06-10 10:32:33 -04:00
ResourcePackages.cs [dotnet] Fix Resharper code issues (#7178) 2021-06-10 10:32:33 -04:00
Serializer.cs iwahbe/8474/dont serialize unknown values (#8475) 2021-11-22 12:40:17 -08:00