core: fix crash case with provisioners [GH-4281]

This commit is contained in:
Mitchell Hashimoto 2014-08-06 13:00:29 -07:00
parent 145af54cec
commit ac0d213c9b
2 changed files with 6 additions and 1 deletions

View File

@ -24,6 +24,7 @@ BUG FIXES:
- core: Windows is not detected as NixOS in some cases. [GH-4302]
- core: Fix encoding issues with Windows. There are still some outlying
but this fixes a few. [GH-4159]
- core: Fix crash case when destroying with an invalid provisioner. [GH-4281]
- commands/package: base package won't crash with exception [GH-4017]
- communicators/winrm: Support `mkdir` [GH-4271]
- guests/centos: Fix issues when NFS client is installed by restarting

View File

@ -16,6 +16,10 @@ module Vagrant
@_provisioner_instances = env[:machine].config.vm.provisioners.map do |provisioner|
# Instantiate the provisioner
klass = Vagrant.plugin("2").manager.provisioners[provisioner.name]
# This can happen in the case the configuration isn't validated.
next nil if !klass
result = klass.new(env[:machine], provisioner.config)
# Store in the type map so that --provision-with works properly
@ -30,7 +34,7 @@ module Vagrant
[result, options]
end
return @_provisioner_instances
return @_provisioner_instances.compact
end
# This will return a mapping of a provisioner instance to its