Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Object#display will raise an exception if passed nil

  • Loading branch information...
commit 830da7187f01affc187a13f8f8d4e5885e58cc4d 1 parent 51b862a
@Watson1978 Watson1978 authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 io.c
View
7 io.c
@@ -3427,10 +3427,13 @@ static VALUE
rb_obj_display(VALUE self, SEL sel, int argc, VALUE *argv)
{
VALUE port;
- rb_scan_args(argc, argv, "01", &port);
- if (NIL_P(port)) {
+
+ if (argc == 0) {
port = rb_stdout;
}
+ else {
+ rb_scan_args(argc, argv, "01", &port);
+ }
rb_io_write(port, self);
return Qnil;
Please sign in to comment.
Something went wrong with that request. Please try again.