summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-12-02 12:07:48 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-12-02 16:45:17 +0100
commit2e2b97f0c919afffb262bfed7058c91264c3107c (patch)
treeb1e8c0f310b16ec7dd1861e1068c7ba28aad785a /sw
parentc90c6c1316d6788601319c1bca8ac1ff1f869c83 (diff)
cid#1470356 silence Dereference null return value
Change-Id: I3df9ce0695531714236025a041c1f4cd46cf7d1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107067 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unoobj2.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 4852fcca9662..eb73fa0f1e80 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -810,14 +810,15 @@ void SwXTextRange::DeleteAndInsert(
if (RANGE_IS_SECTION == m_pImpl->m_eRangePosition)
{
- SwSectionFormat const* pFormat(
- static_cast<SwSectionFormat const*>(m_pImpl->m_pTableOrSectionFormat));
- if (!pFormat)
+ SwSectionNode const* pSectionNode = m_pImpl->m_pTableOrSectionFormat ?
+ static_cast<SwSectionFormat const*>(m_pImpl->m_pTableOrSectionFormat)->GetSectionNode() :
+ nullptr;
+ if (!pSectionNode)
{
throw uno::RuntimeException("disposed?");
}
m_pImpl->m_rDoc.GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT, nullptr);
- SwNodeIndex const start(*pFormat->GetSectionNode());
+ SwNodeIndex const start(*pSectionNode);
SwNodeIndex const end(*start.GetNode().EndOfSectionNode());
// delete tables at start