Skip to content

Commit 4655478

Browse files
correct deserializing if empty lists
1 parent b5b5aa0 commit 4655478

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

MaLoIdentModels/MaLoIdentModels/JsonSettings/EmptyListToNullConverter.cs

+5
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ public override void Write(Utf8JsonWriter writer, List<T>? value, JsonSerializer
4040

4141
private bool IsEmptyModel(T model)
4242
{
43+
if (model is string str)
44+
{
45+
return string.IsNullOrEmpty(str);
46+
}
47+
4348
return typeof(T)
4449
.GetProperties()
4550
.All(property =>

0 commit comments

Comments
 (0)