summaryrefslogtreecommitdiffhomepage
path: root/src/error.c
diff options
context:
space:
mode:
authorPaolo Bosetti <[email protected]>2012-05-30 22:10:02 -0700
committerPaolo Bosetti <[email protected]>2012-05-30 22:10:02 -0700
commit6dbba7b799e0cf1a86ec86f347bbc1b40420d372 (patch)
treeebbc4d9d1a526833fde0819bcd9a1124be656540 /src/error.c
parent1da34f46f4ff4ddff8f5c525aab13fdfd7eb4a99 (diff)
parentfae483ff2a91e806e714cb7d118c7bfb8aadbeb2 (diff)
downloadmruby-6dbba7b799e0cf1a86ec86f347bbc1b40420d372.tar.gz
mruby-6dbba7b799e0cf1a86ec86f347bbc1b40420d372.zip
Merge branch 'master' of git://github.com/mruby/mruby into XCode
Diffstat (limited to 'src/error.c')
-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;
}