diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-19 21:25:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-03-19 21:34:58 +0000 |
commit | 3f243471b57761ea523a19d5c717d06752aa2aa4 (patch) | |
tree | dda17245847eb31658e841c08ff14e6e102298f3 | |
parent | 941ef397e9267f7ca7fac8b2133272f3655ec460 (diff) |
ofz: segv on nullptr
Change-Id: I5ec64411b101972ddd150a782b845d4f790ea873
-rw-r--r-- | comphelper/source/container/embeddedobjectcontainer.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index ea8459596957..f1d8e2bd7d99 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -240,13 +240,12 @@ bool EmbeddedObjectContainer::HasEmbeddedObjects() bool EmbeddedObjectContainer::HasEmbeddedObject( const OUString& rName ) { EmbeddedObjectContainerNameMap::iterator aIt = pImpl->maObjectContainer.find( rName ); - if ( aIt == pImpl->maObjectContainer.end() ) - { - uno::Reference < container::XNameAccess > xAccess( pImpl->mxStorage, uno::UNO_QUERY ); - return xAccess->hasByName(rName); - } - else + if (aIt != pImpl->maObjectContainer.end()) return true; + uno::Reference <container::XNameAccess> xAccess(pImpl->mxStorage, uno::UNO_QUERY); + if (!xAccess.is()) + return false; + return xAccess->hasByName(rName); } bool EmbeddedObjectContainer::HasEmbeddedObject( const uno::Reference < embed::XEmbeddedObject >& xObj ) |