From 17d3671601c9469208bbab65568e0383c5cd45cd Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Thu, 6 Jul 2017 09:26:44 -0700 Subject: [PATCH] make sure that flagVars is not a nil map --- command/meta.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/command/meta.go b/command/meta.go index b8dfdfbf5..187c364a3 100644 --- a/command/meta.go +++ b/command/meta.go @@ -120,6 +120,9 @@ func (m *Meta) FlagSet(n string, fs FlagSetFlags) *flag.FlagSet { f.Var((*kvflag.Flag)(&m.flagVars), "var", "") f.Var((*kvflag.FlagJSON)(&m.flagVars), "var-file", "") } + if len(m.flagVars) == 0 { + m.flagVars = make(map[string]string) + } // Create an io.Writer that writes to our Ui properly for errors. // This is kind of a hack, but it does the job. Basically: create