From 8a5ce08c00cbf1594cd4a1ed192a0235faa8a896 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sat, 26 Dec 2020 14:08:21 +0100 Subject: [PATCH] Fix handling of users without userId --- src/keys.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/keys.js b/src/keys.js index 820ef7d..9b61ce4 100644 --- a/src/keys.js +++ b/src/keys.js @@ -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 }) => {