From a45e62cacdf25fc79e849527b5ca7b24e2532d1e Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Tue, 10 Jan 2017 17:39:28 +0800 Subject: [PATCH] fix the import issue when 'box_ignore_box_vagrantfile' is set, the box object should never be null. --- lib/vagrant/vagrantfile.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/vagrantfile.rb b/lib/vagrant/vagrantfile.rb index 32bb06017..7ee8a2d06 100644 --- a/lib/vagrant/vagrantfile.rb +++ b/lib/vagrant/vagrantfile.rb @@ -191,11 +191,11 @@ module Vagrant local_keys = keys.dup # Load the box Vagrantfile, if there is one - if config.vm.box && !config.vm.box_ignore_box_vagrantfile && boxes + if config.vm.box && boxes box = boxes.find(config.vm.box, box_formats, config.vm.box_version) if box box_vagrantfile = find_vagrantfile(box.directory) - if box_vagrantfile + if box_vagrantfile && !config.vm.box_ignore_box_vagrantfile box_config_key = "#{boxes.object_id}_#{box.name}_#{box.provider}".to_sym @loader.set(box_config_key, box_vagrantfile)