Permalink
Browse files

Added Exception check in mrb_exc_set(); close #3292

PR #3293 just checks for NoMethodError.
  • Loading branch information...
matz committed Nov 27, 2016
1 parent 5ea1bb0 commit 36fc1f1431d9aa85c167f91ef30abe0953c56400
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/error.c
View
@@ -278,6 +278,8 @@ mrb_exc_set(mrb_state *mrb, mrb_value exc)
mrb->exc = 0;
}
else {
if (!mrb_obj_is_kind_of(mrb, exc, mrb->eException_class))
mrb_raise(mrb, E_TYPE_ERROR, "exception object expected");
mrb->exc = mrb_obj_ptr(exc);
}
}

0 comments on commit 36fc1f1

Please sign in to comment.