Skip to content

Commit

Permalink
Fix deserializing an object with a property that is null
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Jan 25, 2022
1 parent 9b9a2b7 commit c1c2c5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Tomlyn/Model/SyntaxToModelTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private bool GetOrCreateSubObject(SourceSpan span, string key, ObjectKind kind)
return false;
}

if (!accessor.TryGetPropertyValue(span, _currentObject!, key, out var currentObject))
if (!accessor.TryGetPropertyValue(span, _currentObject!, key, out var currentObject) || currentObject is null)
{
if (!accessor.TryCreateAndSetDefaultPropertyValue(span, _currentObject!, key, kind, out currentObject))
{
Expand Down

0 comments on commit c1c2c5a

Please sign in to comment.