summaryrefslogtreecommitdiff
path: root/lib/bundler/rubygems_integration.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/rubygems_integration.rb')
-rw-r--r--lib/bundler/rubygems_integration.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index d6f179cc96..f6f0d4a804 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -496,7 +496,9 @@ module Bundler
fetcher = gem_remote_fetcher
fetcher.headers = { "X-Gemfile-Source" => remote.original_uri.to_s } if remote.original_uri
string = fetcher.fetch_path(path)
- Bundler.safe_load_marshal(string)
+ specs = Bundler.safe_load_marshal(string)
+ raise MarshalError, "Specs #{name} from #{remote} is expected to be an Array but was unexpected class #{specs.class}" unless specs.is_a?(Array)
+ specs
rescue Gem::RemoteFetcher::FetchError
# it's okay for prerelease to fail
raise unless name == "prerelease_specs"