diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-03-21 10:56:46 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-21 11:13:49 +0000 |
commit | f5a725abcead37ea63a370d55d6b0d63f25cd271 (patch) | |
tree | 671e2a7c729948da8c41e649aab4a2e9a6e103a5 /xmloff | |
parent | 1f224711746295e6f15d1223792d69bf8971a79b (diff) |
coverity#705096 Dereference after null check
Change-Id: Ie7eed2a697062f495688dc6325ca52383e049d05
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 11 |
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(); |