Add null check to getSecretKeyType

This commit is contained in:
Dominik Schürmann 2014-09-21 18:27:03 +02:00
parent 1f5f937d00
commit d4387c0179

View File

@ -117,7 +117,7 @@ public class CanonicalizedSecretKey extends CanonicalizedPublicKey {
} }
public SecretKeyType getSecretKeyType() { public SecretKeyType getSecretKeyType() {
if (mSecretKey.getS2K().getType() == S2K.GNU_DUMMY_S2K) { if (mSecretKey.getS2K() != null && mSecretKey.getS2K().getType() == S2K.GNU_DUMMY_S2K) {
// divert to card is special // divert to card is special
if (mSecretKey.getS2K().getProtectionMode() == S2K.GNU_PROTECTION_MODE_DIVERT_TO_CARD) { if (mSecretKey.getS2K().getProtectionMode() == S2K.GNU_PROTECTION_MODE_DIVERT_TO_CARD) {
return SecretKeyType.DIVERT_TO_CARD; return SecretKeyType.DIVERT_TO_CARD;