From 32f2370ac805513c4a968bd461d08f66958651d7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 7 Apr 2017 16:55:37 +0100 Subject: Resolves: tdf#102286 lets not crash on null pFrame this is the FlyEmbeddedPrt case ensure we don't end up with a null pFrame at return time (cherry picked from commit 5ce387c4812466e6752b434cf0f5a54f98c6a147) Change-Id: I68ff6f0a36462cffc47d774865e69041c4dd15a8 Reviewed-on: https://gerrit.libreoffice.org/36277 Tested-by: Jenkins Reviewed-by: Michael Stahl --- sw/source/core/frmedt/fews.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 58d0c904f837..c3ba3a6bd6ee 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -123,12 +123,15 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt, case RECT_FLY_PRT_EMBEDDED: bFrame = false; SAL_FALLTHROUGH; - case RECT_FLY_EMBEDDED: pFrame = xObj.is() ? FindFlyFrame( xObj ) + case RECT_FLY_EMBEDDED: + { + const SwFrame *pFlyFrame = xObj.is() ? FindFlyFrame(xObj) : nullptr; + pFrame = pFlyFrame ? pFlyFrame : pFrame->IsFlyFrame() ? pFrame : pFrame->FindFlyFrame(); break; - + } case RECT_OUTTABSECTION_PRT: case RECT_OUTTABSECTION : if( pFrame->IsInTab() ) pFrame = pFrame->FindTabFrame(); -- cgit v1.2.3