summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-12-18 17:17:47 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-12-19 10:00:50 +0100
commit79aaf397017c2748d965b8b56b0da9177bc26288 (patch)
treef95e1502ca8464e67d98f372336f314f337057fa
parent481c67ca64e22ec2f89b88bad090e2fbcaf29d63 (diff)
ofz: Null-deref
Change-Id: I7f59ff4d9db9c769b3ad4ad253160f5d41093f88 Reviewed-on: https://gerrit.libreoffice.org/46734 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/filter/html/swhtml.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 3e92cd43edb3..3860c6407aaf 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -3047,11 +3047,12 @@ bool SwHTMLParser::EndAttr( HTMLAttr* pAttr, bool bChkEmpty )
bInsert = false;
}
- if( bInsert && bScript )
+ const SwTextNode *pTextNd = (bInsert && bScript) ?
+ pAttr->GetSttPara().GetNode().GetTextNode() :
+ nullptr;
+
+ if (pTextNd)
{
- const SwTextNode *pTextNd = pAttr->GetSttPara().GetNode()
- .GetTextNode();
- OSL_ENSURE( pTextNd, "No text node" );
const OUString& rText = pTextNd->GetText();
sal_uInt16 nScriptText = g_pBreakIt->GetBreakIter()->getScriptType(
rText, pAttr->GetSttCnt() );