diff --git a/CHANGELOG.md b/CHANGELOG.md index 647b027e9..bb2fad185 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ IMPROVEMENTS: BUG FIXES: + - commands/package: base package won't crash with exception [GH-4017] - hosts/windows: RDP command works without crash. [GH-3962] - provisioners/puppet: Properly escape facter variables for PowerShell on Windows guests. [GH-3959] diff --git a/lib/vagrant/machine.rb b/lib/vagrant/machine.rb index 765813b07..60670ba01 100644 --- a/lib/vagrant/machine.rb +++ b/lib/vagrant/machine.rb @@ -301,13 +301,15 @@ module Vagrant @env.machine_index.delete(entry) if entry end - # Delete the entire data directory contents since all state - # associated with the VM is now gone. - @data_dir.children.each do |child| - begin - child.rmtree - rescue Errno::EACCES - @logger.info("EACCESS deleting file: #{child}") + if @data_dir + # Delete the entire data directory contents since all state + # associated with the VM is now gone. + @data_dir.children.each do |child| + begin + child.rmtree + rescue Errno::EACCES + @logger.info("EACCESS deleting file: #{child}") + end end end end