aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/dependency.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/dependency.rb')
-rw-r--r--lib/rubygems/dependency.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rubygems/dependency.rb b/lib/rubygems/dependency.rb
index b4a6dd8673..da990fa139 100644
--- a/lib/rubygems/dependency.rb
+++ b/lib/rubygems/dependency.rb
@@ -280,7 +280,7 @@ class Gem::Dependency
if platform_only
matches.reject! { |spec|
- not Gem::Platform.match spec.platform
+ spec.nil? || !Gem::Platform.match(spec.platform)
}
end
@@ -326,11 +326,11 @@ class Gem::Dependency
def to_spec
matches = self.to_specs
- active = matches.find { |spec| spec.activated? }
+ active = matches.find { |spec| spec && spec.activated? }
return active if active
- matches.delete_if { |spec| spec.version.prerelease? } unless prerelease?
+ matches.delete_if { |spec| spec.nil? || spec.version.prerelease? } unless prerelease?
matches.last
end