Skip to content

Commit

Permalink
enforce keyring has been initialized before getting active key
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Oct 6, 2022
1 parent 367a745 commit ce81033
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nomad/encrypter.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ func (e *Encrypter) activeKeySetLocked() (*keyset, error) {
if err != nil {
return nil, err
}
if keyMeta == nil {
return nil, fmt.Errorf("keyring has not been initialized yet")
}

return e.keysetByIDLocked(keyMeta.KeyID)
}
Expand Down

0 comments on commit ce81033

Please sign in to comment.