diff options
author | Olle Jonsson <olle.jonsson@gmail.com> | 2017-02-22 16:31:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-22 16:31:47 +0100 |
commit | 76f2b19e7d727c3af126bc9d6bc163a92c34af2d (patch) | |
tree | 79b9842c5bc1e7ed21794d0a0eddadc121291439 /lib | |
parent | 815200c1a5831710ba3422bf1dcedc5a90c99d2f (diff) | |
download | bundler-76f2b19e7d727c3af126bc9d6bc163a92c34af2d.tar.gz |
Updater.rb: Avoid using String method on nil
- the ETag header may not be available in the response, if so, we ignore that
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/compact_index_client/updater.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bundler/compact_index_client/updater.rb b/lib/bundler/compact_index_client/updater.rb index b407c64039..5aa480fdcc 100644 --- a/lib/bundler/compact_index_client/updater.rb +++ b/lib/bundler/compact_index_client/updater.rb @@ -53,7 +53,7 @@ module Bundler local_temp_path.open(mode) {|f| f << content } end - response_etag = response["ETag"].gsub(%r{\AW/}, "") + response_etag = (response["ETag"] || "").gsub(%r{\AW/}, "") if etag_for(local_temp_path) == response_etag SharedHelpers.filesystem_access(local_path) do FileUtils.mv(local_temp_path, local_path) |