aboutsummaryrefslogtreecommitdiffstats
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/object.c b/object.c
index eba14e0c65..f51d7d43fe 100644
--- a/object.c
+++ b/object.c
@@ -3132,7 +3132,7 @@ rb_convert_to_integer(VALUE val, int base)
rb_raise(rb_eArgError, "base specified for non string value");
}
tmp = convert_type(val, "Integer", "to_int", FALSE);
- if (NIL_P(tmp)) {
+ if (!RB_INTEGER_TYPE_P(tmp)) {
return rb_to_integer(val, "to_i");
}
return tmp;