provisioners/chef: fix crash if run list is somehow nil [GH-5545]

This commit is contained in:
Mitchell Hashimoto 2015-07-05 17:30:29 -07:00
parent 262b50bc02
commit e64cef9d31
1 changed files with 2 additions and 1 deletions

View File

@ -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