From 09b052c7b98867aa763998c50dc5b42ec696af79 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sun, 17 Sep 2023 11:39:00 +0200 Subject: [PATCH] fix: ignore OpenPGP users without userId --- CHANGELOG.md | 2 ++ src/openpgp.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 132c974..136133b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Ignore OpenPGP users without userId ## [1.0.0] - 2023-07-13 ### Changed diff --git a/src/openpgp.js b/src/openpgp.js index af5e9fc..40f7bdc 100644 --- a/src/openpgp.js +++ b/src/openpgp.js @@ -292,6 +292,8 @@ export async function parsePublicKey (publicKey) { const personas = [] users.forEach((user, i) => { + if (!user.userID) return + const pe = new Persona(user.userID.name, []) pe.setIdentifier(user.userID.userID) pe.setDescription(user.userID.comment)