Skip to content

Commit

Permalink
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java
Original file line number Diff line number Diff line change
@@ -481,10 +481,14 @@ public static IRubyObject[] convertValueIntoArgArray(ThreadContext context, IRub
return (value instanceof RubyArray) ? ((RubyArray)value).toJavaArray() : new IRubyObject[] { value };
} else {
IRubyObject val0 = Helpers.aryToAry(value);
if (!(val0 instanceof RubyArray)) {
// FIXME: This logic exists in RubyProc and IRRubyBlockBody. consolidate when we do block call protocol work
if (val0.isNil()) {
return new IRubyObject[] { value };
} else if (!(val0 instanceof RubyArray)) {
throw context.runtime.newTypeError(value.getType().getName() + "#to_ary should return Array");
} else {
return ((RubyArray) val0).toJavaArray();
}
return ((RubyArray)val0).toJavaArray();
}
}
}

0 comments on commit 55e2030

Please sign in to comment.