summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/enumerator.c b/enumerator.c
index 37f8e6b..cfc6a5d 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -3029,6 +3029,9 @@ arith_seq_first(int argc, VALUE *argv, VALUE self)
e = arith_seq_end(self);
s = arith_seq_step(self);
if (argc == 0) {
+ if (NIL_P(b)) {
+ return Qnil;
+ }
if (!NIL_P(e)) {
VALUE zero = INT2FIX(0);
int r = rb_cmpint(rb_num_coerce_cmp(s, zero, idCmp), s, zero);