summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/unocore/unoframe.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index b193f8ed757d..c3d409e02fec 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -3181,12 +3181,14 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursor()
uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursorByRange(const uno::Reference< text::XTextRange > & aTextPosition)
{
SolarMutexGuard aGuard;
- uno::Reference< text::XTextCursor > aRef;
SwFrameFormat* pFormat = GetFrameFormat();
+ if (!pFormat)
+ throw uno::RuntimeException();
SwUnoInternalPaM aPam(*GetDoc());
- if (!pFormat || !::sw::XTextRangeToSwPaM(aPam, aTextPosition))
+ if (!::sw::XTextRangeToSwPaM(aPam, aTextPosition))
throw uno::RuntimeException();
+ uno::Reference<text::XTextCursor> aRef;
SwNode& rNode = pFormat->GetContent().GetContentIdx()->GetNode();
if(aPam.GetNode().FindFlyStartNode() == rNode.FindFlyStartNode())
{