From 732a3fa60bf0ce0b993975a798d3527ecc073bcc Mon Sep 17 00:00:00 2001 From: Jim Kalafut Date: Wed, 24 Oct 2018 13:08:40 -0700 Subject: [PATCH] Fix command panic by returning empty (not nil) map (#5603) Fixes #5600 --- command/base_helpers.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/command/base_helpers.go b/command/base_helpers.go index d4bf3b734f..9f45623e03 100644 --- a/command/base_helpers.go +++ b/command/base_helpers.go @@ -149,6 +149,9 @@ func parseArgsDataString(stdin io.Reader, args []string) (map[string]string, err if err := mapstructure.WeakDecode(raw, &result); err != nil { return nil, errors.Wrap(err, "failed to convert values to strings") } + if result == nil { + result = make(map[string]string) + } return result, nil }