I've got the following if statement, where parent, grandparent, and child are all objects. For some reason, this if throws a NullPointerError when it comes to the parent.isRightChild() check. If this where an issue with the isRightChild() function, I would've caught it fairly easily, but it isn't. This just baffles me, because there should be no way for parent to be null. Thanks in advance.
if (parent != null && grandparent != null
&& (parent.isLeftChild() && child.isRightChild())
|| (parent.isRightChild() && child.isLeftChild())
)