From 13aaf5ebcbb6d5162cc806de7c7f20a8f16b42a8 Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Fri, 10 Nov 2023 13:33:52 -0500 Subject: [PATCH] Simplified method as WriteFieldValue handles nulls. --- .../Serialization/Utf8JsonWriterHelper.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/HotChocolate/AspNetCore/src/Transport.Abstractions/Serialization/Utf8JsonWriterHelper.cs b/src/HotChocolate/AspNetCore/src/Transport.Abstractions/Serialization/Utf8JsonWriterHelper.cs index 1b32247cf6f..ef7035838c2 100644 --- a/src/HotChocolate/AspNetCore/src/Transport.Abstractions/Serialization/Utf8JsonWriterHelper.cs +++ b/src/HotChocolate/AspNetCore/src/Transport.Abstractions/Serialization/Utf8JsonWriterHelper.cs @@ -195,14 +195,7 @@ private static void WriteDictionary( foreach (var item in dict) { writer.WritePropertyName(item.Key); - if (item.Value is null) - { - writer.WriteNullValue(); - } - else - { - WriteFieldValue(writer, item.Value); - } + WriteFieldValue(writer, item.Value); } writer.WriteEndObject();