sw/source/core/crsr/crstrvl.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit d86a6d2b47c6a22d185dc631388ca3f2c0386a35
Author:     Bjoern Michaelsen <bjoern.michael...@libreoffice.org>
AuthorDate: Fri Jul 14 01:03:56 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Fri Jul 14 11:11:04 2023 +0200

    tdf#153866: Fix TOX crash
    
    Im not sure why it should be valid that the ContentFrame should ever be
    nullptr here, but a simple check prevents the immediate crash.
    
    Change-Id: I19a2d04e41271ae6a5b6a3a79c31c3efd5db7875
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154404
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index d5e430bb8711..3face1677c13 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -368,6 +368,8 @@ void SwCursorShell::GotoTOXMarkBase()
     // Take the 1. and get the index type. Ask it for the actual index.
     const SwTOXType* pType = aMarks[0]->GetTOXType();
     auto pContentFrame = pType->FindContentFrame(*GetDoc(), *GetLayout());
+    if(!pContentFrame)
+        return;
     SwCallLink aLk(*this); // watch Cursor-Moves
     SwCursorSaveState aSaveState(*m_pCurrentCursor);
     assert(pContentFrame->IsTextFrame());

Reply via email to