core: fix exception when checksum type is nil
Thanks @johnbellone
This commit is contained in:
parent
e83070371d
commit
0a43cf2b6f
|
@ -21,9 +21,9 @@ module Vagrant
|
||||||
|
|
||||||
# Determine the checksum type to use
|
# Determine the checksum type to use
|
||||||
checksum = (env[:box_checksum] || "").to_s
|
checksum = (env[:box_checksum] || "").to_s
|
||||||
|
checksum_klass = nil
|
||||||
|
if env[:box_checksum_type]
|
||||||
checksum_klass = case env[:box_checksum_type].to_sym
|
checksum_klass = case env[:box_checksum_type].to_sym
|
||||||
when nil
|
|
||||||
nil
|
|
||||||
when :md5
|
when :md5
|
||||||
Digest::MD5
|
Digest::MD5
|
||||||
when :sha1
|
when :sha1
|
||||||
|
@ -34,6 +34,7 @@ module Vagrant
|
||||||
raise Errors::BoxChecksumInvalidType,
|
raise Errors::BoxChecksumInvalidType,
|
||||||
type: env[:box_checksum_type].to_s
|
type: env[:box_checksum_type].to_s
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Go through each URL and attempt to download it
|
# Go through each URL and attempt to download it
|
||||||
download_error = nil
|
download_error = nil
|
||||||
|
|
Loading…
Reference in New Issue