summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'error.c')
-rw-r--r--error.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/error.c b/error.c
index 646fb16232..8bf33e65ad 100644
--- a/error.c
+++ b/error.c
@@ -1134,7 +1134,7 @@ syserr_initialize(int argc, VALUE *argv, VALUE self)
if (!NIL_P(error) && st_lookup(syserr_tbl, NUM2LONG(error), &data)) {
klass = (VALUE)data;
/* change class */
- if (TYPE(self) != T_OBJECT) { /* insurance to avoid type crash */
+ if (!RB_TYPE_P(self, T_OBJECT)) { /* insurance to avoid type crash */
rb_raise(rb_eTypeError, "invalid instance type");
}
RBASIC(self)->klass = klass;