Handle encrypt error in EncryptAttachment
This commit is contained in:
parent
99c48c2e4e
commit
ea2fcb9438
1 changed files with 3 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue