summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/enum.c b/enum.c
index 102257fa761..a50de77a901 100644
--- a/enum.c
+++ b/enum.c
@@ -660,6 +660,7 @@ enum_min(obj)
VALUE result = Qundef;
rb_iterate(rb_each, obj, rb_block_given_p() ? min_ii : min_i, (VALUE)&result);
+ if (result == Qundef) return Qnil;
return result;
}
@@ -736,6 +737,7 @@ enum_max(obj)
VALUE result = Qundef;
rb_iterate(rb_each, obj, rb_block_given_p() ? max_ii : max_i, (VALUE)&result);
+ if (result == Qundef) return Qnil;
return result;
}