Check for trailing comment

In the case of a trailing comment, this
was calling #getParent() on the root
which then returned null.