From b5b7f746dfd6cf9be752431978e05f19c5d2c2cd Mon Sep 17 00:00:00 2001 From: Greg Renda <104654128+gregrenda@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:31:10 -0700 Subject: fix null pointer exception when using public only keys (#3143) (#3144) Co-authored-by: Greg Renda --- .../src/main/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crypto/pgpainless/src/main') diff --git a/crypto/pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt b/crypto/pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt index b3f2a64b..40288ffc 100644 --- a/crypto/pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt +++ b/crypto/pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPainlessCryptoHandler.kt @@ -54,7 +54,7 @@ public class PGPainlessCryptoHandler @Inject constructor() : } val keyringCollection = keys - .map { key -> PGPainless.readKeyRing().secretKeyRing(key.contents) } + .mapNotNull { key -> PGPainless.readKeyRing().secretKeyRing(key.contents) } .run(::PGPSecretKeyRingCollection) val protector = SecretKeyRingProtector.unlockAnyKeyWith(Passphrase.fromPassword(passphrase)) val decryptionStream = -- cgit v1.2.3