diff options
author | Tor Lillqvist <tml@collabora.com> | 2017-12-22 15:23:43 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2017-12-22 15:24:02 +0200 |
commit | 1b73ed91e1cce20b3b552a36d449fb96cc57bf4f (patch) | |
tree | ba020e7db899f19b3edcb7a32acca4369318f4f0 /cui/source/options/optgenrl.cxx | |
parent | 381398928f1112a9c26ee1dbae55a06feac17cc6 (diff) |
Avoid crash without GPG
Change-Id: I5489012544fdf736784608b274359ea99f9ffe45
Diffstat (limited to 'cui/source/options/optgenrl.cxx')
-rw-r--r-- | cui/source/options/optgenrl.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx index c25144f04266..0816a8c49821 100644 --- a/cui/source/options/optgenrl.cxx +++ b/cui/source/options/optgenrl.cxx @@ -308,15 +308,18 @@ void SvxGeneralTabPage::InitCryptography() { xSEInitializer = xml::crypto::GPGSEInitializer::create( comphelper::getProcessComponentContext() ); uno::Reference<xml::crypto::XXMLSecurityContext> xSC = xSEInitializer->createSecurityContext( OUString() ); - uno::Reference<xml::crypto::XSecurityEnvironment> xSE = xSC->getSecurityEnvironment(); - uno::Sequence<uno::Reference<security::XCertificate>> xCertificates = xSE->getPersonalCertificates(); - - if (xCertificates.hasElements()) + if (xSC.is()) { - for (auto& xCert : xCertificates) + uno::Reference<xml::crypto::XSecurityEnvironment> xSE = xSC->getSecurityEnvironment(); + uno::Sequence<uno::Reference<security::XCertificate>> xCertificates = xSE->getPersonalCertificates(); + + if (xCertificates.hasElements()) { - m_pSigningKeyLB->InsertEntry( xCert->getIssuerName()); - m_pEncryptionKeyLB->InsertEntry( xCert->getIssuerName()); + for (auto& xCert : xCertificates) + { + m_pSigningKeyLB->InsertEntry( xCert->getIssuerName()); + m_pEncryptionKeyLB->InsertEntry( xCert->getIssuerName()); + } } } } |