sw/source/uibase/docvw/edtwin.cxx |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit df77dcbbb2ecd3a272a3ea55877a1b1c9fd8ef03
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Wed Dec 22 23:58:09 2021 -0900
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Dec 24 15:56:12 2021 +0100

    Outline folding: check pointer before use
    
    Change-Id: Ifa79ef5f286da77fdac9464b4e271021107bf34e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127348
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <rayk...@gmail.com>
    (cherry picked from commit 1609bb6ab5e34fc8fff67240e3c49dde93f2d2d7)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127379
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index 5fea06590626..0fc6e91b594d 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -3908,10 +3908,15 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
                 SwContentFrame* pContentFrame = 
aSwContentAtPos.aFnd.pNode->GetTextNode()->getLayoutFrame(nullptr);
                 if (pContentFrame != m_pSavedOutlineFrame)
                 {
-                    if (m_pSavedOutlineFrame && 
!m_pSavedOutlineFrame->IsInDtor() &&
-                            
rNds.GetOutLineNds().Seek_Entry(static_cast<SwTextFrame*>(m_pSavedOutlineFrame)->GetTextNodeFirst(),
 &nPos) &&
-                            rSh.GetAttrOutlineContentVisible(nPos))
-                        
GetFrameControlsManager().RemoveControlsByType(FrameControlType::Outline, 
m_pSavedOutlineFrame);
+                    if (m_pSavedOutlineFrame && 
!m_pSavedOutlineFrame->IsInDtor())
+                    {
+                        SwTextNode* pTextNode =
+                                
static_cast<SwTextFrame*>(m_pSavedOutlineFrame)->GetTextNodeFirst();
+                        if (pTextNode && 
rNds.GetOutLineNds().Seek_Entry(pTextNode, &nPos) &&
+                                rSh.GetAttrOutlineContentVisible(nPos))
+                            GetFrameControlsManager().RemoveControlsByType(
+                                        FrameControlType::Outline, 
m_pSavedOutlineFrame);
+                    }
                     m_pSavedOutlineFrame = pContentFrame;
                 }
                 // show button

Reply via email to