From 193321503804586ebf7da3ea1e00bcc109bc1968 Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 13 Mar 2017 09:05:35 +0000 Subject: [PATCH] Raise error if spec is nil With parallel test-all, the spec is sometimes nil. To debug it raise more detailed error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems/specification.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index 5bbaec3911..a2f289d162 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -1128,6 +1128,9 @@ class Gem::Specification < Gem::BasicSpecification native = {} specs.reverse_each do |spec| + unless spec + raise Gem::Exception, "unexpectedly spec is nil: #{specs}" + end next if spec.version.prerelease? unless prerelease native[spec.name] = spec.version if spec.platform == Gem::Platform::RUBY