educative.io

Why does (root == null) mean that there are no children?

Hello just curious why I cant use root.left and root.right equaling null. It gives me a null pointer exception which i can kind of understand the reasoning but I thought root == null would mean that specific node being null and not its children.
Any explanation would be appreciated!
Im looking at the Java code on line 13

you shouldn’t be getting a null pointer exception if you’re checking root == null before root.left == null && root.right == null