Argument is only invalid if nil and expected type is not NilClass

This commit is contained in:
Chris Roberts 2021-11-17 14:53:15 -08:00 committed by Paul Hinze
parent 4b14221be4
commit a0797da229
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0

View File

@ -176,7 +176,7 @@ module VagrantPlugins
value = args.detect do |arg|
input.valid?(arg)
end
if !value
if value.nil? && input.type != NilClass
raise ArgumentError,
"Failed to locate required argument of type `#{input.type}'"
end