We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 951a27a commit 0b9d6d6Copy full SHA for 0b9d6d6
templates/dotnet/Package/Extensions/Extensions.cs.twig
@@ -17,7 +17,7 @@ namespace {{ spec.title | caseUcfirst }}.Extensions
17
{
18
return value switch
19
20
- JsonElement jsonElement => jsonElement.Deserialize<List<T>>()!,
+ JsonElement jsonElement => jsonElement.Deserialize<List<T>>() ?? throw new InvalidCastException($"Cannot deserialize {jsonElement} to List<{typeof(T)}>."),
21
object[] objArray => objArray.Cast<T>().ToList(),
22
List<T> list => list,
23
IEnumerable<T> enumerable => enumerable.ToList(),
0 commit comments