From 31844c5212b6a356f73100eb28dd99e021ca77a6 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 13 Nov 2020 15:11:33 +0100 Subject: [PATCH] break for-loop of addUserId method when finding key --- .../java/org/pgpainless/key/modification/KeyRingEditor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgpainless-core/src/main/java/org/pgpainless/key/modification/KeyRingEditor.java b/pgpainless-core/src/main/java/org/pgpainless/key/modification/KeyRingEditor.java index 0626744c..f1299b7e 100644 --- a/pgpainless-core/src/main/java/org/pgpainless/key/modification/KeyRingEditor.java +++ b/pgpainless-core/src/main/java/org/pgpainless/key/modification/KeyRingEditor.java @@ -91,7 +91,7 @@ public class KeyRingEditor implements KeyRingEditorInterface { Iterator secretKeyIterator = secretKeyRing.getSecretKeys(); boolean found = false; - while (secretKeyIterator.hasNext()) { + while (!found && secretKeyIterator.hasNext()) { PGPSecretKey secretKey = secretKeyIterator.next(); if (secretKey.getKeyID() == keyId) { found = true;