Fix handling users without selfCertifications

This commit is contained in:
Yarmo Mackenbach 2020-12-26 13:56:36 +01:00
parent 47e538770c
commit 32c01756d3

View file

@ -159,14 +159,18 @@ const process = (publicKey) => {
},
}
const notations = user.selfCertifications[0].rawNotations
usersOutput[i].notations = notations.map(
({ name, value, humanReadable }) => {
if (humanReadable && name === 'proof@metacode.biz') {
return openpgp.util.decode_utf8(value)
if ('selfCertifications' in user && user.selfCertifications.length >= 0) {
const notations = user.selfCertifications[0].rawNotations
usersOutput[i].notations = notations.map(
({ name, value, humanReadable }) => {
if (humanReadable && name === 'proof@metacode.biz') {
return openpgp.util.decode_utf8(value)
}
}
}
)
)
} else {
usersOutput[i].notations = []
}
})
resolve({