From fae483ff2a91e806e714cb7d118c7bfb8aadbeb2 Mon Sep 17 00:00:00 2001 From: Yukihiro Matsumoto Date: Thu, 31 May 2012 11:15:51 +0900 Subject: the argument for Exception.new is optinal --- src/error.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/error.c b/src/error.c index feaa04af7..ae89541c1 100644 --- a/src/error.c +++ b/src/error.c @@ -56,9 +56,9 @@ exc_initialize(mrb_state *mrb, mrb_value exc) { mrb_value mesg; - mrb_get_args(mrb, "o", &mesg); - mrb_iv_set(mrb, exc, mrb_intern(mrb, "mesg"), mesg); - + if (mrb_get_args(mrb, "|o", &mesg) == 1) { + mrb_iv_set(mrb, exc, mrb_intern(mrb, "mesg"), mesg); + } return exc; } -- cgit v1.2.3