diff --git a/lib/backports/3.2.0/enumerator/product.rb b/lib/backports/3.2.0/enumerator/product.rb index 87337ab6..c6268242 100644 --- a/lib/backports/3.2.0/enumerator/product.rb +++ b/lib/backports/3.2.0/enumerator/product.rb @@ -56,7 +56,7 @@ def size @__enums.each do |enum| return nil unless enum.respond_to?(:size) size = enum.size - return size if size == nil || size == Float::INFINITY + return size if size == nil || size == Float::INFINITY || size == 0 return nil unless size.is_a?(Integer) total_size *= size end