Skip to content

Commit

Permalink
Merge pull request #1447 from HridoyRoy/vault-1392
Browse files Browse the repository at this point in the history
add nil check to secret get [VAULT-1392]
  • Loading branch information
eikenb committed Jan 22, 2021
2 parents 8fb3626 + 8ea4f8e commit 929ea6a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dependency/vault_common.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package dependency

import (
"fmt"
"log"
"math/rand"
"time"

"encoding/json"

"github.com/hashicorp/vault/api"
)

Expand Down Expand Up @@ -301,6 +303,9 @@ func isKVv2(client *api.Client, path string) (string, bool, error) {
if err != nil {
return "", false, err
}
if secret == nil {
return "", false, fmt.Errorf("secret at path %s does not exist", path)
}
var mountPath string
if mountPathRaw, ok := secret.Data["path"]; ok {
mountPath = mountPathRaw.(string)
Expand Down

0 comments on commit 929ea6a

Please sign in to comment.