Fixed error with empty shell provisioner

`read` returns nil on empty files, so the call to `valid_encoding` fails.
This commit is contained in:
Bernhard Morgenstern 2014-04-09 22:56:15 +02:00
parent 9529dd8cde
commit 247a2470c0
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ module VagrantPlugins
:path => expanded_path)
else
data = expanded_path.read(16)
if !data.valid_encoding?
if data != nil && !data.valid_encoding?
errors << I18n.t(
"vagrant.provisioners.shell.invalid_encoding",
actual: data.encoding.to_s,