Skip to content

Commit 8a36e6c

Browse files
committed
pr review: remove check for non-optional object
1 parent 5ef5e8b commit 8a36e6c

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

extension/js/content_scripts/webmail/thunderbird/thunderbird-element-replacer.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,15 @@ export class ThunderbirdElementReplacer extends WebmailElementReplacer {
164164
};
165165

166166
private downloadThunderbirdAttachmentHandler = async (decryptedFileName: string, encryptedData: Buf) => {
167-
if (encryptedData) {
168-
const result = await MsgUtil.decryptMessage({
169-
kisWithPp: await KeyStore.getAllWithOptionalPassPhrase(this.acctEmail),
170-
encryptedData,
171-
verificationPubs: [], // todo: #4158 signature verification of attachments
172-
});
173-
if (result.success && result.content) {
174-
await BrowserMsg.send.bg.await.thunderbirdInitiateAttachmentDownload({ decryptedFileName, decryptedContent: result.content });
175-
}
176-
// no need to handle DecryptErrTypes.needPassphrase it was already handled by this.messageDecrypt()
167+
const result = await MsgUtil.decryptMessage({
168+
kisWithPp: await KeyStore.getAllWithOptionalPassPhrase(this.acctEmail),
169+
encryptedData,
170+
verificationPubs: [], // todo: #4158 signature verification of attachments
171+
});
172+
if (result.success && result.content) {
173+
await BrowserMsg.send.bg.await.thunderbirdInitiateAttachmentDownload({ decryptedFileName, decryptedContent: result.content });
177174
}
175+
// no need to handle DecryptErrTypes.needPassphrase it was already handled by this.messageDecrypt()
178176
};
179177

180178
private resemblesSignedMsg = (body: string) => {

0 commit comments

Comments
 (0)