From 0c9b0117093df05bd7539325c500ec3fbdff982d Mon Sep 17 00:00:00 2001 From: Brian Kassouf Date: Fri, 3 May 2019 09:10:41 -0700 Subject: [PATCH] Fix a panic caused by a nil response on kv pre-flight (#6675) * Fix a panic caused by a nil response on kv pre-flight * Fix imports --- command/kv_helpers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/command/kv_helpers.go b/command/kv_helpers.go index 654584089b..d9246f7a08 100644 --- a/command/kv_helpers.go +++ b/command/kv_helpers.go @@ -1,6 +1,7 @@ package command import ( + "errors" "fmt" "io" "path" @@ -69,6 +70,9 @@ func kvPreflightVersionRequest(client *api.Client, path string) (string, int, er if err != nil { return "", 0, err } + if secret == nil { + return "", 0, errors.New("nil response from pre-flight request") + } var mountPath string if mountPathRaw, ok := secret.Data["path"]; ok { mountPath = mountPathRaw.(string)