summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-09-03 09:28:39 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-09-03 17:31:21 +0200
commit48beccf52413981d3d1c525a81a2c57048abe261 (patch)
treec6b65530122ea5a86a090ed6cba87aa34de23108 /sw
parentac77d8a368e1ed21211bfe7768149481502317df (diff)
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/+/121547 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121604 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/uiview/view2.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index a9dbb22b904a..7c342e761a69 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1360,6 +1360,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