summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-03-21 10:56:46 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-03-21 11:13:49 +0000
commitf5a725abcead37ea63a370d55d6b0d63f25cd271 (patch)
tree671e2a7c729948da8c41e649aab4a2e9a6e103a5 /xmloff
parent1f224711746295e6f15d1223792d69bf8971a79b (diff)
coverity#705096 Dereference after null check
Change-Id: Ie7eed2a697062f495688dc6325ca52383e049d05
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/text/txtparae.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 04bb4829fe76..a1315f0ecba8 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -1061,15 +1061,20 @@ void XMLTextParagraphExport::exportListChange(
}
}
+ bool bEndElement = false;
+
if ( rNextInfo.GetLevel() > 0 &&
rNextInfo.IsNumbered() &&
rPrevInfo.BelongsToSameList( rNextInfo ) &&
rPrevInfo.GetLevel() >= rNextInfo.GetLevel() )
{
- // close previous list-item
- DBG_ASSERT( pListElements && pListElements->size() >= 2,
- "SwXMLExport::ExportListChange: list elements missing" );
+ assert(pListElements && pListElements->size() >= 2); //list elements missing
+ bEndElement = pListElements && pListElements->size() >= 2;
+ }
+ if (bEndElement)
+ {
+ // close previous list-item
GetExport().EndElement(pListElements->back(), sal_True );
pListElements->pop_back();