summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-05-31 11:15:51 +0900
committerYukihiro Matsumoto <[email protected]>2012-05-31 11:15:51 +0900
commitfae483ff2a91e806e714cb7d118c7bfb8aadbeb2 (patch)
tree6befd365c77abbcfcbc819fe1998e05cb49c108e /src
parente3c1b48ba25e97967a5f27869653af05fad90dd2 (diff)
downloadmruby-fae483ff2a91e806e714cb7d118c7bfb8aadbeb2.tar.gz
mruby-fae483ff2a91e806e714cb7d118c7bfb8aadbeb2.zip
the argument for Exception.new is optinal
Diffstat (limited to 'src')
-rw-r--r--src/error.c6
1 files 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;
}