Skip to content

Commit 1ee9007

Browse files
committed
Fixes #3483. define_method with empty body throws RuntimeError in interpreter
1 parent 2fa04aa commit 1ee9007

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/jruby/ast/IterNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public IterNode(ISourcePosition position, ArgsNode args, Node body, StaticScope
6666
super(position, args != null && args.containsVariableAssignment || body != null && body.containsVariableAssignment);
6767

6868
this.varNode = args;
69-
this.bodyNode = body;
69+
this.bodyNode = body == null ? NilImplicitNode.NIL : body;
7070
this.scope = scope;
7171
}
7272

0 commit comments

Comments
 (0)