Merge pull request #163 from ProtonMail/attachment-processor-errors

Fix attachment processor error handling
This commit is contained in:
wussler 2022-02-15 11:00:19 +01:00 committed by GitHub
commit 444f29b089
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,6 +54,9 @@ func (ap *AttachmentProcessor) Finish() (*PGPSplitMessage, error) {
}
ap.done.Wait()
if ap.err != nil {
return nil, ap.err
}
splitMsg := ap.split
if ap.garbageCollector > 0 {
@ -94,7 +97,7 @@ func (keyRing *KeyRing) newAttachmentProcessor(
Data: ciphertext,
}
split, splitError := message.SeparateKeyAndData(estimatedSize, garbageCollector)
if attachmentProc.err != nil {
if attachmentProc.err == nil {
attachmentProc.err = splitError
}
attachmentProc.split = split