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)