Skip to content

Commit

Permalink
fix #316
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-montrose committed Mar 14, 2019
1 parent eeeb0c0 commit 759c252
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Jil/DeserializeDynamic/JsonObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,14 @@ internal void Put(JsonObject other)
if (MemberPart2 == null)
{
MemberPart2 = other;
this.Parent.ObjectMembers.Add(MemberPart1.StringValue, MemberPart2);
try
{
this.Parent.ObjectMembers.Add(MemberPart1.StringValue, MemberPart2);
}
catch (ArgumentException e)
{
throw new DeserializationException($"Tried to add duplicate member \"{MemberPart1.StringValue}\" to an object", e, false);
}
}
else
{
Expand Down

0 comments on commit 759c252

Please sign in to comment.