1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-30 00:02:06 +01:00

Prevent NPE in SOP when reading certificates

This commit is contained in:
Paul Schaub 2021-06-11 14:38:56 +02:00
parent e587fc46b8
commit 56ddd5e70f
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -51,6 +51,9 @@ public class SopKeyUtil {
PGPPublicKeyRingCollection collection = PGPainless.readKeyRing() PGPPublicKeyRingCollection collection = PGPainless.readKeyRing()
.keyRingCollection(in, true) .keyRingCollection(in, true)
.getPgpPublicKeyRingCollection(); .getPgpPublicKeyRingCollection();
if (collection == null) {
throw new PGPException("Provided file " + file.getName() + " does not contain a certificate.");
}
for (PGPPublicKeyRing keyRing : collection) { for (PGPPublicKeyRing keyRing : collection) {
publicKeyRings.add(keyRing); publicKeyRings.add(keyRing);
} }