From 0478a4f7c24066255497afb16e50e103fb08002e Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Tue, 12 Jan 2016 08:46:49 -0500 Subject: [PATCH] Fix read panic when an empty argument is given. Fixes #923 --- command/read.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/command/read.go b/command/read.go index c862a7ab64..715c54f590 100644 --- a/command/read.go +++ b/command/read.go @@ -24,7 +24,7 @@ func (c *ReadCommand) Run(args []string) int { } args = flags.Args() - if len(args) != 1 { + if len(args) != 1 || len(args[0]) == 0 { c.Ui.Error("read expects one argument") flags.Usage() return 1 @@ -103,7 +103,7 @@ Read Options: delimited table. This can also be json or yaml. -field=field If included, the raw value of the specified field - will be output raw to stdout. + will be output raw to stdout. ` return strings.TrimSpace(helpText)