mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 22:49:28 -07:00
Fix handling of users without userId
This commit is contained in:
parent
a8389bd0b6
commit
8a5ce08c00
1 changed files with 5 additions and 5 deletions
10
src/keys.js
10
src/keys.js
|
@ -151,15 +151,15 @@ const process = (publicKey) => {
|
||||||
users.forEach((user, i) => {
|
users.forEach((user, i) => {
|
||||||
usersOutput[i] = {
|
usersOutput[i] = {
|
||||||
userData: {
|
userData: {
|
||||||
id: user.userId.userid,
|
id: user.userId ? user.userId.userid : null,
|
||||||
name: user.userId.name,
|
name: user.userId ? user.userId.name : null,
|
||||||
email: user.userId.email,
|
email: user.userId ? user.userId.email : null,
|
||||||
comment: user.userId.comment,
|
comment: user.userId ? user.userId.comment : null,
|
||||||
isPrimary: primaryUser.index === i,
|
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
|
const notations = user.selfCertifications[0].rawNotations
|
||||||
usersOutput[i].notations = notations.map(
|
usersOutput[i].notations = notations.map(
|
||||||
({ name, value, humanReadable }) => {
|
({ name, value, humanReadable }) => {
|
||||||
|
|
Loading…
Reference in a new issue