summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2022-05-31 15:06:53 +0200
committerAndras Timar <andras.timar@collabora.com>2022-06-01 12:30:37 +0200
commit3c8376a00636091b1c90970b4bd8a2a2eae9da52 (patch)
tree2398424100ae5306cb0bff3879da0633a5fff8da
parent78b6d38ceeb5f231b89123aade179a184517ebef (diff)
sw: fix crash in SwAnchoredObject::UpdateObjInSortedListco-22.05.2-1
See https://crashreport.libreoffice.org/stats/signature/SwAnchoredObject::UpdateObjInSortedList() Just a few lines above (line 636) the same checks are used inside the DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION condition so I don't understand why they weren't added here as well Change-Id: Id8ade0a506d5996d9e357d45c20fe56a68a93eec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135188 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit 64f8a70298695d1952c3a399e897755ab861add5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135170 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sw/source/core/layout/anchoredobject.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx
index 23c1e2f17906..c38cfcb03931 100644
--- a/sw/source/core/layout/anchoredobject.cxx
+++ b/sw/source/core/layout/anchoredobject.cxx
@@ -651,7 +651,8 @@ void SwAnchoredObject::UpdateObjInSortedList()
AnchorFrame()->GetDrawObjs()->Update( *this );
// update its position in the sorted object list of its page frame
// note: as-character anchored object aren't registered at a page frame
- if ( GetFrameFormat().GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR )
+ if ( GetPageFrame() && GetPageFrame()->GetSortedObjs() &&
+ GetFrameFormat().GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR )
{
GetPageFrame()->GetSortedObjs()->Update( *this );
}