sw/source/core/unocore/unoobj2.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 4b7ef8a9755e9e7b6876d64ae7888d9c3c3308ff
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Dec 1 14:17:07 2020 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Dec 1 20:37:44 2020 +0100

    cid#1470356 silence Dereference null return value
    
    Change-Id: Ie3a30e3952e245d642b0b257dfdc444533940ba7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106989
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/core/unocore/unoobj2.cxx 
b/sw/source/core/unocore/unoobj2.cxx
index a2b98d41d307..4852fcca9662 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -810,14 +810,14 @@ void SwXTextRange::DeleteAndInsert(
 
     if (RANGE_IS_SECTION == m_pImpl->m_eRangePosition)
     {
-        if (!m_pImpl->m_pTableOrSectionFormat)
+        SwSectionFormat const* pFormat(
+            static_cast<SwSectionFormat 
const*>(m_pImpl->m_pTableOrSectionFormat));
+        if (!pFormat)
         {
             throw uno::RuntimeException("disposed?");
         }
         m_pImpl->m_rDoc.GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT, 
nullptr);
-        SwSectionFormat const& rFormat(
-            *static_cast<SwSectionFormat 
const*>(m_pImpl->m_pTableOrSectionFormat));
-        SwNodeIndex const start(*rFormat.GetSectionNode());
+        SwNodeIndex const start(*pFormat->GetSectionNode());
         SwNodeIndex const end(*start.GetNode().EndOfSectionNode());
 
         // delete tables at start
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to