sw/source/core/txtnode/ndtxt.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 98843d0817ec676576c5c224d158636599379144
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue Jul 4 17:56:05 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Fri Jul 7 11:16:27 2023 +0200

    sw: fix crash in SwTextNode::Update
    
    FindPageFrame might return nullptr
    Introduced with c684301352bcca709bc8d1c99e0f08e7096e9716
    "(related: tdf#149595) sw: also re-sort SwSortedObjs on SwPageFrame"
    See 
https://crashreport.libreoffice.org/stats/signature/SwTextNode::Update(SwContentIndex%20const%20&,long,SwContentIndexReg::UpdateMode)
    
    Change-Id: I2e8df1428400f6752eafaaa6102a1fc3de3f0daa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153977
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit a62af0444515ab28bc0ffdc8ff7f320ca962bbc0)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154112

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index a334baf87634..9d5e0955d85e 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1603,7 +1603,9 @@ void SwTextNode::Update(
             pSortedObjs->UpdateAll();
         }
         // also sort the objs on the page frame
-        pSortedObjs = pFrame->FindPageFrame()->GetSortedObjs();
+        if (SwPageFrame *pPage = pFrame->FindPageFrame())
+            pSortedObjs = pPage->GetSortedObjs();
+
         if (pSortedObjs) // doesn't exist yet if called for inserting as-char 
fly
         {
             pSortedObjs->UpdateAll();

Reply via email to