From e121ef45809e2585ac40bbf33e472c107a6b2879 Mon Sep 17 00:00:00 2001 From: Agnelo Vaz Date: Fri, 27 Jan 2017 17:54:10 +0000 Subject: [PATCH] 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 --- dali-toolkit/internal/builder/tree-node-manipulator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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() ) ) { -- 2.7.4