Handle encrypt error in EncryptAttachment

This commit is contained in:
Daniel Huigens 2019-04-27 07:31:29 +02:00
parent 99c48c2e4e
commit ea2fcb9438

View file

@ -75,14 +75,13 @@ func (pm *PmCrypto) encryptAttachment(estimatedSize int, fileName string, public
var ew io.WriteCloser
var encryptErr error
ew, encryptErr = openpgp.Encrypt(writer, publicKey.entities, nil, hints, config)
if encryptErr != nil {
return nil, encryptErr
}
attachmentProc.w = &ew
attachmentProc.pipe = writer
if attachmentProc.err != nil {
attachmentProc.err = encryptErr
}
return attachmentProc, nil
}
// Use: ios/android only