Fix a fatal error when an AST node is potentially null.