mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-29 15:52:08 +01:00
Prevent NPE in SOP when reading certificates
This commit is contained in:
parent
e587fc46b8
commit
56ddd5e70f
1 changed files with 3 additions and 0 deletions
|
@ -51,6 +51,9 @@ public class SopKeyUtil {
|
|||
PGPPublicKeyRingCollection collection = PGPainless.readKeyRing()
|
||||
.keyRingCollection(in, true)
|
||||
.getPgpPublicKeyRingCollection();
|
||||
if (collection == null) {
|
||||
throw new PGPException("Provided file " + file.getName() + " does not contain a certificate.");
|
||||
}
|
||||
for (PGPPublicKeyRing keyRing : collection) {
|
||||
publicKeyRings.add(keyRing);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue