Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/RicoSuter/NJsonSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
RicoSuter committed Sep 16, 2022
2 parents 011e04f + 6749851 commit e045ae8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/NJsonSchema/Converters/JsonExceptionConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,16 @@ public override object ReadJson(JsonReader reader, Type objectType, object exist
}
else
{
field = GetField(objectType, "m_" + property.Value.Substring(0, 1).ToLowerInvariant() + property.Value.Substring(1));
var fieldNameSuffix = property.Value.Substring(0, 1).ToLowerInvariant() + property.Value.Substring(1);

field = GetField(objectType, "m_" + fieldNameSuffix);
if (field != null)
{
field.SetValue(value, propertyValue);
}
else
{
field = GetField(objectType, "_" + property.Value.Substring(0, 1).ToLowerInvariant() + property.Value.Substring(1));
field = GetField(objectType, "_" + fieldNameSuffix);
if (field != null)
{
field.SetValue(value, propertyValue);
Expand Down

0 comments on commit e045ae8

Please sign in to comment.