sw: fix crash in SwTextNode::Update

FindPageFrame might return nullptr
Introduced with c684301352
"(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.stahl@allotropia.de>
This commit is contained in:
Xisco Fauli
2023-07-04 17:56:05 +02:00
committed by Michael Stahl
parent 45d7ffb7f2
commit a62af04445

View File

@@ -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();