From 074bb2c7fbe31bce36c44fcf34a0ca951c13cd35 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 3 Jan 2014 11:19:17 -0800 Subject: [PATCH] core: fix potential exception case in SSHExec middleware --- lib/vagrant/action/builtin/ssh_exec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/vagrant/action/builtin/ssh_exec.rb b/lib/vagrant/action/builtin/ssh_exec.rb index 4e644e38d..bd9197b9d 100644 --- a/lib/vagrant/action/builtin/ssh_exec.rb +++ b/lib/vagrant/action/builtin/ssh_exec.rb @@ -28,11 +28,11 @@ module Vagrant # not yet ready for SSH, so we raise this exception. raise Errors::SSHNotReady if info.nil? - if info[:private_key_path] - # Check SSH key permissions - info[:private_key_path].each do |path| - SSH.check_key_permissions(Pathname.new(path)) - end + info[:private_key_path] ||= [] + + # Check SSH key permissions + info[:private_key_path].each do |path| + SSH.check_key_permissions(Pathname.new(path)) end if info[:private_key_path].empty? && info[:password]