Skip to content

Commit

Permalink
Add file exists check for decrypt-keys helper
Browse files Browse the repository at this point in the history
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
  • Loading branch information
lumjjb committed Jun 22, 2021
1 parent 49be3d4 commit 1272152
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion helpers/parse_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ func processRecipientKeys(recipients []string) ([][]byte, [][]byte, [][]byte, []
func processx509Certs(keys []string) ([][]byte, error) {
var x509s [][]byte
for _, key := range keys {
tmp, err := ioutil.ReadFile(strings.Split(key, ":")[0])
fileName := strings.Split(key, ":")[0]
if _, err := os.Stat(fileName); os.IsNotExist(err) {
continue
}
tmp, err := ioutil.ReadFile(fileName)
if err != nil {
return nil, errors.Wrap(err, "Unable to read file")
}
Expand Down

0 comments on commit 1272152

Please sign in to comment.