From: Agnelo Vaz Date: Fri, 27 Jan 2017 17:54:10 +0000 (+0000) Subject: Enable json tree dump to work with empty arrays X-Git-Tag: dali_1.2.25~7^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=e121ef45809e2585ac40bbf33e472c107a6b2879 Enable json tree dump to work with empty arrays If the json contains an empty array it would crash as there was no check before dereferencing a pointer. Below constant section should be added to json to get debug output "constants": { "CONFIG_SCRIPT_LOG_LEVEL":"Verbose", "DUMP_TREE":1 }, Change-Id: I9584fa0c4202ea7907a9235cdfb81264ab3596c6 --- diff --git a/dali-toolkit/internal/builder/tree-node-manipulator.cpp b/dali-toolkit/internal/builder/tree-node-manipulator.cpp index 4357cb8..9567306 100644 --- a/dali-toolkit/internal/builder/tree-node-manipulator.cpp +++ b/dali-toolkit/internal/builder/tree-node-manipulator.cpp @@ -398,7 +398,7 @@ void TreeNodeManipulator::DoWrite(const TreeNode *value, std::ostream& output, i { bool groupMyChildren = false; - if( TreeNode::ARRAY == value->GetType() && + if( TreeNode::ARRAY == value->GetType() && value->mFirstChild && ( TreeNode::INTEGER == value->mFirstChild->GetType() || TreeNode::FLOAT == value->mFirstChild->GetType() ) ) {