diff --git a/src/main/java/com/google/api/generator/engine/ast/ForStatement.java b/src/main/java/com/google/api/generator/engine/ast/ForStatement.java index 7c6222d411..b1216b6210 100644 --- a/src/main/java/com/google/api/generator/engine/ast/ForStatement.java +++ b/src/main/java/com/google/api/generator/engine/ast/ForStatement.java @@ -48,6 +48,7 @@ public abstract static class Builder { public ForStatement build() { ForStatement forStatement = autoBuild(); + NodeValidator.checkNoNullElements(forStatement.body(), "body", "for-statement"); Preconditions.checkState( forStatement.localVariableExpr().isDecl(), "For-statement variable must be a declaration");