Skip to content

Commit

Permalink
Merge pull request #3107 from AdmiringWorm/null-handling
Browse files Browse the repository at this point in the history
(maint) Fix null config value throwing exception
  • Loading branch information
gep13 authored Apr 11, 2023
2 parents 09fb543 + efd475d commit e68fab9
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ private void OutputToString(StringBuilder propertyValues, IEnumerable<PropertyIn
AppendOutput(propertyValues, output);
}
}
else if (objectValue is null)
{
var output = "{0}{1}={{null}}".FormatWith(
string.IsNullOrWhiteSpace(prepend) ? "" : prepend + ".",
propertyInfo.Name);

AppendOutput(propertyValues, output);
}
else
{
OutputToString(propertyValues, propertyInfo.PropertyType.GetProperties(), objectValue, propertyInfo.Name);
Expand Down

0 comments on commit e68fab9

Please sign in to comment.