IDEA-228410 Avoid the NPE when a secret key has multiple user ids attached to it

GitOrigin-RevId: 6a10c3a5dc7c76bb790048ebf6638f15b88765c4
This commit is contained in:
Andrey Shcheglov
2019-12-06 16:32:22 +00:00
committed by intellij-monorepo-bot
parent 13fc4f69e5
commit 3d07ac359e
+3 -2
View File
@@ -34,6 +34,9 @@ internal class Pgp(private val gpgTool: GpgToolWrapper = createGpg()) {
capabilities = fields.next()
}
/*
* There may be multiple user identities ("uid") following a single secret key ("sec").
*/
"uid" -> {
// a potential letter 'D' to indicate a disabled key
// e :: Encrypt
@@ -46,8 +49,6 @@ internal class Pgp(private val gpgTool: GpgToolWrapper = createGpg()) {
// The value is quoted like a C string to avoid control characters (the colon is quoted =\x3a=).
result.add(PgpKey(keyId!!, fields.next().replace("=\\x3a=", ":")))
}
keyId = null
capabilities = null
}
}
}