diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-05-24 16:07:28 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-24 16:11:02 +0100 |
commit | 675776170671ba0a1fc1b2bf9e915537cd08b080 (patch) | |
tree | c2bc4041749862f320a901145f0c8cbf5cf230b9 /sot | |
parent | a5219c79027bce36880270ddbe3a058fa042265e (diff) |
coverity#441341 Dereference after null check
Change-Id: I7c3df9438d9b81e0f50f8143772b997672ca7abb
Diffstat (limited to 'sot')
-rw-r--r-- | sot/source/sdstor/ucbstorage.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 8ea792cd7c5e..df435babfe4f 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -2157,7 +2157,7 @@ sal_Int16 UCBStorage_Impl::Commit() if ( !pElement->m_bIsInserted ) { // first remove all open stream handles - if( !pElement->m_xStream.Is() || pElement->m_xStream->Clear() ) + if (pContent && (!pElement->m_xStream.Is() || pElement->m_xStream->Clear())) { pContent->executeCommand( OUString("delete"), makeAny( true ) ); nRet = COMMIT_RESULT_SUCCESS; @@ -2199,7 +2199,7 @@ sal_Int16 UCBStorage_Impl::Commit() pContent = pElement->GetContent(); } - if ( pElement->m_aName != pElement->m_aOriginalName ) + if (pContent && pElement->m_aName != pElement->m_aOriginalName) { // name ( title ) of the element was changed nLocalRet = COMMIT_RESULT_SUCCESS; @@ -2208,7 +2208,7 @@ sal_Int16 UCBStorage_Impl::Commit() pContent->setPropertyValue("Title", aAny ); } - if ( pElement->IsLoaded() && pElement->GetContentType() != pElement->GetOriginalContentType() ) + if (pContent && pElement->IsLoaded() && pElement->GetContentType() != pElement->GetOriginalContentType()) { // mediatype of the element was changed nLocalRet = COMMIT_RESULT_SUCCESS; |