Null check Added.

Check tree against Null before dereferencing as done at line : 213