The location of this assert matches the line number in the stack trace.
Later versions of libjsoncpp don't assert but throw an exception instead. I suspect that's why we are seeing this only on the phone because, on the desktop, we are using version 0.10.5.
In the get_node() overload for string, we have:
if (!root_)
{
throw unity::LogicException("Current node is empty");
}
if (!root_.isMember(node_name))
{
throw unity::LogicException("Node " + node_name + " does not exist");
}
// ...
I'm pushing a branch that checks the node type before calling isMember() and throws if the node type isn't objectValue. I expect that'll stop the crash.
The question still is why we are trying to get a member from something that isn't an object. Marcus, is this expected?
On the phone, we are using 0.6.0-rc2 of libjsoncpp. Looking at the git repository, the assertion triggers if the node type is not objectValue:
JSON_ASSERT( type_ == nullValue || type_ == objectValue );
The location of this assert matches the line number in the stack trace.
Later versions of libjsoncpp don't assert but throw an exception instead. I suspect that's why we are seeing this only on the phone because, on the desktop, we are using version 0.10.5.
In the get_node() overload for string, we have:
if (!root_) LogicException( "Current node is empty");
{
throw unity::
}
if (!root_ .isMember( node_name) ) LogicException( "Node " + node_name + " does not exist");
{
throw unity::
}
// ...
I'm pushing a branch that checks the node type before calling isMember() and throws if the node type isn't objectValue. I expect that'll stop the crash.
The question still is why we are trying to get a member from something that isn't an object. Marcus, is this expected?