From abfe416503517ca6eaa1569818154fb498ec1741 Mon Sep 17 00:00:00 2001 From: Ashley Hughes Date: Tue, 1 Apr 2014 23:02:35 +0100 Subject: [PATCH] sort out saving empty string IDs --- .../keychain/pgp/PgpKeyOperation.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java index 0e828d859..0aa8b7410 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/pgp/PgpKeyOperation.java @@ -478,9 +478,7 @@ public class PgpKeyOperation { PGPSignature certification = sGen.generateCertification(userId, masterPublicKey); sigList.add(new Pair(userId, certification)); } - if (!origID.equals("")) { - masterPublicKey = PGPPublicKey.removeCertification(masterPublicKey, origID); - } + masterPublicKey = PGPPublicKey.removeCertification(masterPublicKey, origID); userIDIndex++; } for (Pair toAdd : sigList) { @@ -502,9 +500,7 @@ public class PgpKeyOperation { sGen.setUnhashedSubpackets(unhashedPacketsGen.generate()); } PGPSignature certification = sGen.generateCertification(userId, masterPublicKey); - if (!origID.equals("")) { - masterPublicKey = PGPPublicKey.removeCertification(masterPublicKey, origID); - } + masterPublicKey = PGPPublicKey.removeCertification(masterPublicKey, origID); masterPublicKey = PGPPublicKey.addCertification(masterPublicKey, userId, certification); } userIDIndex++; @@ -523,9 +519,7 @@ public class PgpKeyOperation { sigList.add(new Pair(userId, sig)); } } - if (!userId.equals("")) { - masterPublicKey = PGPPublicKey.removeCertification(masterPublicKey, userId); - } + masterPublicKey = PGPPublicKey.removeCertification(masterPublicKey, userId); userIDIndex++; } anyIDChanged = true;