Null checks, needed by the scalagen project which re-uses the AST