Fix handling of users without userId

This commit is contained in:
Yarmo Mackenbach 2020-12-26 14:08:21 +01:00
parent a8389bd0b6
commit 8a5ce08c00

View file

@ -151,15 +151,15 @@ const process = (publicKey) => {
users.forEach((user, i) => {
usersOutput[i] = {
userData: {
id: user.userId.userid,
name: user.userId.name,
email: user.userId.email,
comment: user.userId.comment,
id: user.userId ? user.userId.userid : null,
name: user.userId ? user.userId.name : null,
email: user.userId ? user.userId.email : null,
comment: user.userId ? user.userId.comment : null,
isPrimary: primaryUser.index === i,
},
}
if ('selfCertifications' in user && user.selfCertifications.length >= 0) {
if ('selfCertifications' in user && user.selfCertifications.length > 0) {
const notations = user.selfCertifications[0].rawNotations
usersOutput[i].notations = notations.map(
({ name, value, humanReadable }) => {