Skip to content

Commit

Permalink
Fixes #5608. Kernel#warn doesn't handle exceptions as expected.
Browse files Browse the repository at this point in the history
This was a more basic problem that was not calling to_s() in the case that
the argument is not already a String.
  • Loading branch information
enebo committed Feb 15, 2019
1 parent 27231cf commit e509934
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyKernel.java
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ public static IRubyObject warn(ThreadContext context, IRubyObject recv, IRubyObj
return context.nil;
}

return warn(context, recv, _message.convertToString());
return warn(context, recv, _message.asString());
}

static IRubyObject warn(ThreadContext context, IRubyObject recv, RubyString message) {
Expand Down

0 comments on commit e509934

Please sign in to comment.