summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmlsecurity/source/dialogs/certificatechooser.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx
index 32c688f2a257..795e9bf3ae07 100644
--- a/xmlsecurity/source/dialogs/certificatechooser.cxx
+++ b/xmlsecurity/source/dialogs/certificatechooser.cxx
@@ -220,13 +220,15 @@ void CertificateChooser::ImplInitialize()
#if HAVE_FEATURE_GPGME
// only GPG has preferred keys
- if ( sIssuer == msPreferredKey )
- {
- if ( meAction == UserAction::Sign || meAction == UserAction::SelectSign )
- m_xCertLB->select(nRow);
- else if ( meAction == UserAction::Encrypt &&
- aUserOpts.GetEncryptToSelf() )
- mxEncryptToSelf = xCert;
+ if ( !sIssuer.isEmpty() && !msPreferredKey.isEmpty() ) {
+ if ( sIssuer == msPreferredKey )
+ {
+ if ( meAction == UserAction::Sign || meAction == UserAction::SelectSign )
+ m_xCertLB->select(nRow);
+ else if ( meAction == UserAction::Encrypt &&
+ aUserOpts.GetEncryptToSelf() )
+ mxEncryptToSelf = xCert;
+ }
}
#endif
}