From e64cef9d31a22ea9ca007a16b8af8e97abf13904 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 5 Jul 2015 17:30:29 -0700 Subject: [PATCH] provisioners/chef: fix crash if run list is somehow nil [GH-5545] --- plugins/provisioners/chef/provisioner/base.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/provisioners/chef/provisioner/base.rb b/plugins/provisioners/chef/provisioner/base.rb index c7d6aa3a7..2de3d28cf 100644 --- a/plugins/provisioners/chef/provisioner/base.rb +++ b/plugins/provisioners/chef/provisioner/base.rb @@ -132,7 +132,8 @@ module VagrantPlugins # Get the JSON that we're going to expose to Chef json = @config.json - json[:run_list] = @config.run_list if !@config.run_list.empty? + json[:run_list] = @config.run_list if @config.run_list && + !@config.run_list.empty? json = JSON.pretty_generate(json) # Create a temporary file to store the data so we