summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-01 20:11:08 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-08-03 11:16:04 +0200
commitec79d0127f90d65d722e46688b6cfcf2f5e59794 (patch)
tree5fd50221aa00fe3b47b69de9b3bcb57871aaa233 /sw
parent36bee88834f90818c5475b460c729186ef6c9229 (diff)
forcepoint#67 null deref
Change-Id: I666c6b1795e037d3bb74d4ccc33be0e161bfb157 Reviewed-on: https://gerrit.libreoffice.org/58445 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
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())
{