forked from Mirrors/keyoxide-web
fix: handle doip promise rejection
This commit is contained in:
parent
44f9664300
commit
1373f14587
1 changed files with 10 additions and 1 deletions
|
@ -102,7 +102,16 @@ const fetchWKD = (id) => {
|
||||||
reject(new Error('No public keys could be read from the data fetched using WKD'))
|
reject(new Error('No public keys could be read from the data fetched using WKD'))
|
||||||
}
|
}
|
||||||
|
|
||||||
profile = await doipjs.openpgp.parsePublicKey(publicKey)
|
try {
|
||||||
|
profile = await doipjs.openpgp.parsePublicKey(publicKey)
|
||||||
|
} catch (error) {
|
||||||
|
profile = null
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!profile) {
|
||||||
|
reject(new Error('No public keys could be fetched using WKD'))
|
||||||
|
return
|
||||||
|
}
|
||||||
profile.publicKey.fetch.method = 'wkd'
|
profile.publicKey.fetch.method = 'wkd'
|
||||||
profile.publicKey.fetch.query = id
|
profile.publicKey.fetch.query = id
|
||||||
profile.publicKey.fetch.resolvedUrl = fetchURL
|
profile.publicKey.fetch.resolvedUrl = fetchURL
|
||||||
|
|
Loading…
Reference in a new issue