diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java b/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java index 7999b592..b69e301b 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/info/KeyRingInfo.java @@ -289,16 +289,16 @@ public class KeyRingInfo { return null; } - String firstUserId = userIds.get(0); - if (userIds.size() == 1) { - return firstUserId; - } - + String firstUserId = null; for (String userId : userIds) { PGPSignature certification = signatures.userIdCertifications.get(userId); if (certification == null) { continue; } + + if (firstUserId == null) { + firstUserId = userId; + } Date creationTime = certification.getCreationTime(); if (certification.getHashedSubPackets().isPrimaryUserID()) {