Ensure provider_config is a hash before calling .empty?

This commit is contained in:
Brian Cain 2020-04-21 15:45:49 -07:00
parent d07e6c5c6a
commit 754928a206
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0

View File

@ -184,11 +184,13 @@ module VagrantPlugins
end
end
if !@provider_config.empty?
if !@provider_config.keys.include?(machine.provider_name)
machine.env.ui.warn(I18n.t("vagrant.config.disk.missing_provider",
machine: machine.name,
provider_name: machine.provider_name))
if @provider_config
if !@provider_config.empty?
if !@provider_config.keys.include?(machine.provider_name)
machine.env.ui.warn(I18n.t("vagrant.config.disk.missing_provider",
machine: machine.name,
provider_name: machine.provider_name))
end
end
end