Skip to content

Commit 3ab5d6c

Browse files
committed
Better logic in the checkReciepientsKeys()
1 parent 3bca6ee commit 3ab5d6c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

extension/chrome/elements/compose-modules/compose-recipients-module.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,8 +805,11 @@ export class ComposeRecipientsModule extends ViewModule<ComposeView> {
805805
const email = $(recipientEl).text().trim();
806806
const dbContacts = await ContactStore.get(undefined, [email]);
807807
if (dbContacts) {
808-
recipientEl.element.classList.remove('no_pgp');
809-
await this.renderPubkeyResult(recipientEl, dbContacts as Contact[]);
808+
const realDbContacts = dbContacts.filter(contact => contact !== undefined);
809+
if (realDbContacts && realDbContacts.length) {
810+
recipientEl.element.classList.remove('no_pgp');
811+
await this.renderPubkeyResult(recipientEl, realDbContacts as Contact[]);
812+
}
810813
}
811814
}
812815
}

0 commit comments

Comments
 (0)