Test that now value can be added when all nodes are allocated

This commit is contained in:
Benoit Blanchon
2014-09-30 17:14:59 +02:00
parent 22e36bbe9c
commit 27a4d57f7c
2 changed files with 6 additions and 3 deletions

View File

@ -75,8 +75,11 @@ JsonNode* JsonObject::getOrCreateNodeAt(char const* key)
JsonBuffer* buffer = _node->content.asObject.buffer;
JsonNode* newValueNode = buffer->createNode(JSON_UNDEFINED);
if (!newValueNode) return 0;
JsonNode* newKeyNode = buffer->createNode(JSON_KEY);
if (!newKeyNode) return 0;
newKeyNode->content.asKey.key = key;
newKeyNode->content.asKey.value = newValueNode;