diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-05-31 11:15:51 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-05-31 11:15:51 +0900 |
| commit | fae483ff2a91e806e714cb7d118c7bfb8aadbeb2 (patch) | |
| tree | 6befd365c77abbcfcbc819fe1998e05cb49c108e | |
| parent | e3c1b48ba25e97967a5f27869653af05fad90dd2 (diff) | |
| download | mruby-fae483ff2a91e806e714cb7d118c7bfb8aadbeb2.tar.gz mruby-fae483ff2a91e806e714cb7d118c7bfb8aadbeb2.zip | |
the argument for Exception.new is optinal
| -rw-r--r-- | src/error.c | 6 |
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; } |
