From 84435fe55791090665c68f869bd5b7e9e5273740 Mon Sep 17 00:00:00 2001 From: Kang Wang Date: Mon, 14 Aug 2023 18:33:19 +0800 Subject: [PATCH] Fixed a nil panic issue in vault provider (#224) --- providers/vault/vault.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/providers/vault/vault.go b/providers/vault/vault.go index 202220aa..44dcbe7e 100644 --- a/providers/vault/vault.go +++ b/providers/vault/vault.go @@ -72,6 +72,10 @@ func (r *Vault) Read() (map[string]interface{}, error) { return nil, err } + if secret == nil { + return nil, errors.New("vault provider fetched no data") + } + s := secret.Data if r.cfg.ExcludeMeta { s = secret.Data["data"].(map[string]interface{})