Permalink
Browse files

When merging DOM a NULL on the src deletes the item in the dst.

  • Loading branch information...
Martin York Martin York
Martin York authored and Martin York committed May 12, 2012
1 parent 925486d commit 398929be39964e5b5a531a936e5ce70494c6ff87
Showing with 9 additions and 0 deletions.
  1. +9 −0 Json/JsonUtil.cpp
View
@@ -21,9 +21,18 @@ static void mergeJsonDom(JsonMap& dst, JsonMap& src, std::string const& errorMsg
}
else
{
+ JsonNULLItem* nil = dynamic_cast<JsonNULLItem*>(loop->second);
+ if (nil != NULL)
+ {
+ // JsonNull objects cause the node in the destination to be deleted.
+ dst.erase(find);
+ continue;
+ }
+
JsonMapItem* map = dynamic_cast<JsonMapItem*>(find->second);
JsonArrayItem* arr = dynamic_cast<JsonArrayItem*>(find->second);
+
if ((map == NULL) && (arr == NULL))
{
// Normal Item (not map or array).

0 comments on commit 398929b

Please sign in to comment.