From efd103f3e58fcf3aeb6c4a0d3dd9233448698231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Sat, 17 Dec 2022 01:54:46 +0100 Subject: [rubygems/rubygems] Fix crash when showing some resolution errors If the conflict explanation includes empty ranges and version unions, Pub Grub was crashing. https://github.com/rubygems/rubygems/commit/eb360b77a2 --- lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb b/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb index b66c603dfd..c898a6522d 100644 --- a/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb +++ b/lib/bundler/vendor/pub_grub/lib/pub_grub/version_union.rb @@ -77,7 +77,7 @@ module Bundler::PubGrub return true end - if !my_range.max || (other_range.max && other_range.max < my_range.max) + if !my_range.max || other_range.empty? || (other_range.max && other_range.max < my_range.max) other_range = other_ranges.shift else my_range = my_ranges.shift @@ -119,7 +119,7 @@ module Bundler::PubGrub while my_range && other_range new_ranges << my_range.intersect(other_range) - if !my_range.max || (other_range.max && other_range.max < my_range.max) + if !my_range.max || other_range.empty? || (other_range.max && other_range.max < my_range.max) other_range = other_ranges.shift else my_range = my_ranges.shift -- cgit v1.2.3