fix(encryptor): correctly send an error when there is no encryption key

It would crash otherwise, leaving no message
This commit is contained in:
Jonathan Rainville 2023-03-24 14:32:15 -04:00
parent bcca0b399d
commit ed639a9f4a
1 changed files with 3 additions and 0 deletions

View File

@ -670,6 +670,9 @@ func (s *encryptor) encryptWithHR(groupID []byte, keyID uint32, payload []byte)
if err != nil {
return nil, err
}
if hrCache == nil {
return nil, errors.New("no encryption key found for the community")
}
var dbHash []byte
if len(hrCache.Hash) == 0 {