summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'error.c')
-rw-r--r--error.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/error.c b/error.c
index b0eb716103..64e5183cca 100644
--- a/error.c
+++ b/error.c
@@ -337,7 +337,10 @@ static VALUE
exc_backtrace(exc)
VALUE exc;
{
- return rb_iv_get(exc, "bt");
+ ID bt = rb_intern("bt");
+
+ if (!rb_ivar_defined(exc, bt)) return Qnil;
+ return rb_ivar_get(exc, bt);
}
static VALUE