File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
extension/js/service_worker Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -168,11 +168,12 @@ export class BgHandlers {
168168 ) : Promise < Bm . Res . ThunderbirdGetDownloadableAttachment > => {
169169 const processableAttachments : Bm . Res . ThunderbirdGetDownloadableAttachment = [ ] ;
170170 const [ tab ] = await messenger . mailTabs . query ( { active : true , currentWindow : true } ) ;
171- if ( tab . id ) {
171+ const message = await messenger . messageDisplay . getDisplayedMessage ( tab . id ) ;
172+ if ( tab . id && message ?. id ) {
172173 const fcAttachments : Attachment [ ] = [ ] ;
173174 // convert Thunderbird Attachments to FlowCrypt recognizable Attachments
174175 for ( const tbAttachment of r . attachments ) {
175- const rawAttachment = await messenger . messages . getAttachmentFile ( tab . id , tbAttachment . partName ) ;
176+ const rawAttachment = await messenger . messages . getAttachmentFile ( message . id , tbAttachment . partName ) ;
176177 fcAttachments . push (
177178 new Attachment ( {
178179 data : new Uint8Array ( await rawAttachment . arrayBuffer ( ) ) ,
You can’t perform that action at this time.
0 commit comments