Check if the node has children before accessing them
Merge pull request #26 from mleduque/IDEX-1288

Check if the node has children before accessing them