sw/source/core/unocore/unoobj2.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit 2e2b97f0c919afffb262bfed7058c91264c3107c Author: Caolán McNamara <[email protected]> AuthorDate: Wed Dec 2 12:07:48 2020 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Wed Dec 2 16:45:17 2020 +0100 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 <[email protected]> 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 _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
