Skip to content

Commit

Permalink
Preserve null values when serializing to storage (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgillum committed Nov 2, 2020
1 parent 42229fa commit 429065f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/DurableTask.Core/Serializing/JsonDataConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ public override string Serialize(object value)
/// <returns>Object serialized to a string</returns>
public override string Serialize(object value, bool formatted)
{
if (value == null)
{
// This avoids serializing null into "null"
return null;
}

var sb = new StringBuilder(0x100);
var textWriter = new StringWriter(sb, CultureInfo.InvariantCulture);
using (var writer = new JsonTextWriter(textWriter))
Expand Down
6 changes: 3 additions & 3 deletions tools/DurableTask.props
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
<!-- Nuget Package Settings -->
<PropertyGroup>
<PackageOutputPath>..\..\build_output\packages</PackageOutputPath>
<AssemblyVersion>2.4.1</AssemblyVersion>
<FileVersion>2.4.1</FileVersion>
<Version>2.4.1</Version>
<AssemblyVersion>2.4.2</AssemblyVersion>
<FileVersion>2.4.2</FileVersion>
<Version>2.4.2</Version>
<Company>Microsoft</Company>
<Authors>Microsoft</Authors>
<Product>Durable Task Framework</Product>
Expand Down

0 comments on commit 429065f

Please sign in to comment.