Make sure that curr.children.entries()
is not a null value. Perhaps, DTN
returns a null value if that node has no children. This would cause your NullPointerException
.
Try doing a quick check before you begin the iteration.
if(curr.children.entries() != null)
{
//It's safe, so procede with going deeper into the trie.
}