Fix read panic when an empty argument is given.

Fixes #923
This commit is contained in:
Jeff Mitchell 2016-01-12 08:46:49 -05:00
parent e815db8756
commit 8cb23835d7

View file

@ -24,7 +24,7 @@ func (c *ReadCommand) Run(args []string) int {
} }
args = flags.Args() args = flags.Args()
if len(args) != 1 { if len(args) != 1 || len(args[0]) == 0 {
c.Ui.Error("read expects one argument") c.Ui.Error("read expects one argument")
flags.Usage() flags.Usage()
return 1 return 1