Skip to content

Commit 88d8263

Browse files
author
Tom J
committed
ensure there is a domain
1 parent a759d85 commit 88d8263

File tree

1 file changed

+4
-1
lines changed
  • extension/js/common/api/key-server

1 file changed

+4
-1
lines changed

extension/js/common/api/key-server/wkd.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ export class Wkd extends Api {
2929

3030
public lookupEmail = async (email: string): Promise<PubkeySearchResult> => {
3131
const parts = email.split('@');
32-
if (parts.length > 2) {
32+
if (parts.length !== 2) {
3333
return { pubkey: null, pgpClient: null };
3434
}
3535
const [user, recipientDomain] = parts;
36+
if (!user || !recipientDomain) {
37+
return { pubkey: null, pgpClient: null };
38+
}
3639
if (!opgp) {
3740
// pgp_block.htm does not have openpgp loaded
3841
// the particular usecase (auto-loading pubkeys to verify signatures) is not that important,

0 commit comments

Comments
 (0)