TreeNode treat nullpointer in case treenode or object is null