diff --git a/src/error.c b/src/error.c index 6674fe7ad..fe193a9a9 100644 --- a/src/error.c +++ b/src/error.c @@ -200,6 +200,7 @@ exc_debug_info(mrb_state *mrb, struct RObject *exc) mrb_callinfo *ci = mrb->c->ci; mrb_code *pc = ci->pc; + if (!exc || exc == mrb->nomem_err) return; if (mrb_obj_iv_defined(mrb, exc, mrb_intern_lit(mrb, "file"))) return; while (ci >= mrb->c->cibase) { mrb_code *err = ci->err;