[Libreoffice-commits] core.git: sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 1 19:38:30 UTC 2020


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

New commits:
commit 4b7ef8a9755e9e7b6876d64ae7888d9c3c3308ff
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Dec 1 14:17:07 2020 +0000
Commit:     Caolán McNamara <caolanm at 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 <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at 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


More information about the Libreoffice-commits mailing list