diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-12 10:51:28 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-12 12:36:21 +0100 |
commit | fd3bd604496b925c80fb9bfb50de459325f545e0 (patch) | |
tree | 64fa7a30b8da1873c24969ad4977832e6998cf93 /xmlsecurity | |
parent | dd615af367a11749e6490a40b4d9bcfaeebe7046 (diff) |
xmlsecurity: gracefully handle lack of META-INF storage stream
Change-Id: Ic0b33f7b014ea7cfb16cc1babb69f2d2b6ba8dee
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 0d4319c60a89..bb93298a0d30 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -283,15 +283,22 @@ void DigitalSignaturesDialog::SetStorage( const com::sun::star::uno::Reference < Reference < css::packages::manifest::XManifestReader > xReader = css::packages::manifest::ManifestReader::create(mxCtx); - //Get the manifest.xml - Reference < css::embed::XStorage > xSubStore(rxStore->openStorageElement( - "META-INF", css::embed::ElementModes::READ), UNO_QUERY_THROW); + uno::Reference<container::XNameAccess> xNameAccess(rxStore, uno::UNO_QUERY); + if (!xNameAccess.is()) + return; + + if (xNameAccess->hasByName("META-INF")) + { + //Get the manifest.xml + Reference < css::embed::XStorage > xSubStore(rxStore->openStorageElement( + "META-INF", css::embed::ElementModes::READ), UNO_QUERY_THROW); - Reference< css::io::XInputStream > xStream( - xSubStore->openStreamElement("manifest.xml", css::embed::ElementModes::READ), - UNO_QUERY_THROW); + Reference< css::io::XInputStream > xStream( + xSubStore->openStreamElement("manifest.xml", css::embed::ElementModes::READ), + UNO_QUERY_THROW); - m_manifest = xReader->readManifestSequence(xStream); + m_manifest = xReader->readManifestSequence(xStream); + } } void DigitalSignaturesDialog::SetSignatureStream( const css::uno::Reference < css::io::XStream >& rxStream ) |