Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
verifying that secrets exist before attempting to return them
Browse files Browse the repository at this point in the history
  • Loading branch information
jprobinson committed Jan 29, 2019
1 parent d61e70c commit 21efaa6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gcpvault.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ func getLocalSecrets(ctx context.Context, cfg Config) (map[string]interface{}, e
if err != nil {
return nil, errors.Wrap(err, "unable to get secrets")
}

if secrets == nil {
return nil, errors.New("no secrets found")
}
return secrets.Data, nil
}

Expand Down

0 comments on commit 21efaa6

Please sign in to comment.