From 889014c9b86f35048bc00ae97c3ccba6f6989417 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 3 Sep 2021 17:33:19 +0200 Subject: sw: fix crash in SwView::Execute() Crashreport: program/../program/libswlo.so SwView::Execute(SfxRequest&) sw/source/uibase/uiview/view2.cxx:1312 program/libmergedlo.so SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) sfx2/source/control/dispatch.cxx:263 /opt/collaboraoffice6.4/program/libmergedlo.so SfxDispatcher::Execute_(SfxShell&, SfxSlot const&, SfxRequest&, SfxCallMode) sfx2/source/control/dispatch.cxx:760 (discriminator 3) /opt/collaboraoffice6.4/program/libmergedlo.so SfxDispatcher::Execute(unsigned short, SfxCallMode, SfxItemSet const*, SfxItemSet const*, unsigned short) sfx2/source/control/dispatch.cxx:819 Change-Id: I2e7b27f458971dbd33971589f71337c59981ee83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121611 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- sw/source/uibase/uiview/view2.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index ca1751702b71..a38b6a8510d3 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1404,6 +1404,11 @@ void SwView::Execute(SfxRequest &rReq) const sal_uLong newPosY = newPosYTwips->GetValue(); const Point mPoint(newPosX, newPosY); const SdrHdl* handle = pSdrView->GetHdlList().GetHdl(handleNum); + if (!handle) + { + break; + } + if (handle->GetKind() == SdrHdlKind::Anchor || handle->GetKind() == SdrHdlKind::Anchor_TR) m_pWrtShell->FindAnchorPos(mPoint, /*bMoveIt=*/true); else -- cgit v1.2.3