summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-02-23 10:11:08 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-02-23 12:16:00 +0100
commit3c0662373361938822559d43b031b4c63850e32e (patch)
tree1c6ed63fc305b23e25f1428fdd2123f7f618aa1c /package
parentb2965afb8ba8ac155206a8dd790cd54ecfbf6d33 (diff)
cid#1500664 Dereference before null check
this looks sensible at: commit e7c7d6f0e9cf0185188e864f6419667073283dcc Author: Kurt Zenker <kz@openoffice.org> Date: Thu Sep 11 09:16:30 2003 +0000 INTEGRATION: CWS mav05 (1.1.2); FILE ADDED as: if ( (*pElementIter)->m_bIsStorage ) { OSL_ENSURE( (*pElementIter)->m_pStorage && (*pElementIter)->m_pStorage->m_xPackageFolder.is(), "An inserted storage is incomplete!\n" ); if ( !(*pElementIter)->m_pStorage || !(*pElementIter)->m_pStorage->m_xPackageFolder.is() ) throw uno::RuntimeException(); // TODO xNewElement = uno::Reference< lang::XUnoTunnel >( (*pElementIter)->m_pStorage->m_xPackageFolder, uno::UNO_QUERY ); (*pElementIter)->m_pStorage->Commit(); } and then didn't after: commit 8c64f087f88173b3101307176cccdd03e6558c69 Author: Rüdiger Timm <rt@openoffice.org> Date: Thu Oct 30 08:48:27 2003 +0000 INTEGRATION: CWS mav08 (1.2.10); FILE MERGED 2003/10/15 08:07:55 mav 1.2.10.2: #i21121# substorages implement transacted mode 2003/10/13 14:26:33 mav 1.2.10.1: #i21121# Transacted mode for storages Change-Id: Ib05359b282d078cd40b41ed8f2fe9242235c9c83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130417 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'package')
-rw-r--r--package/source/xstor/xstorage.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index ba942c867379..c99057368421 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -1130,12 +1130,12 @@ void OStorage_Impl::Commit()
if ( pElement->m_bIsStorage )
{
+ OSL_ENSURE(pElement->m_xStorage, "An inserted storage is incomplete!");
+ if (!pElement->m_xStorage)
+ throw uno::RuntimeException( THROW_WHERE );
+
if (pElement->m_xStorage->m_bCommited)
{
- OSL_ENSURE(pElement->m_xStorage, "An inserted storage is incomplete!");
- if (!pElement->m_xStorage)
- throw uno::RuntimeException( THROW_WHERE );
-
pElement->m_xStorage->InsertIntoPackageFolder(/*aName*/pair.first, xNewPackageFolder);
pElement->m_bIsInserted = false;