Skip to content

Commit

Permalink
Add check for nil secret
Browse files Browse the repository at this point in the history
  • Loading branch information
waiariki-koia committed Dec 3, 2020
1 parent abf3365 commit 132b109
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/vault/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (m *DefaultManager) Save() error {

func (m *DefaultManager) renewSecret(leaseID string) error {
secret, err := m.client.Sys().Renew(leaseID, int(m.lease.Seconds()))
if err != nil {
if err != nil || secret == nil {
log.Errorf("error renewing lease: %s", err)
fatalError := checkFatalError(err)
if fatalError != nil {
Expand Down Expand Up @@ -189,7 +189,7 @@ func (m *DefaultManager) renewCertificate() error {

func renewAuth(client *api.Client, renew int) error {
secret, err := client.Auth().Token().RenewSelf(renew)
if err != nil {
if err != nil || secret == nil {
log.Errorf("error renewing token: %s", err)
fatalError := checkFatalError(err)
if fatalError != nil {
Expand Down

0 comments on commit 132b109

Please sign in to comment.