diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-09-12 21:37:43 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-09-20 14:11:05 +0200 |
commit | 7d703f00ed94b0d6ea44132896f1926fb68c1c04 (patch) | |
tree | 415d5a33a950d8ab91cc2cc2fe90890be2fe957a | |
parent | f133621aeb78a37dc4d9db7a0eb7d0bde4637fb2 (diff) |
tdf#108402: avoid crash if filter doesn't match
See bt https://bugs.documentfoundation.org/attachment.cgi?id=134006
+ display warning
Change-Id: I38496364c0965015ea54f753f3d3550f317d88d8
Reviewed-on: https://gerrit.libreoffice.org/60413
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
(cherry picked from commit 475ea37809b5bec369d02a5ab500fac46ab40f0a)
Reviewed-on: https://gerrit.libreoffice.org/60791
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
-rw-r--r-- | sw/source/filter/xml/xmlexp.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 8a7da0693df1..eb13bc3db732 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -125,6 +125,8 @@ ErrCode SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) } SwDoc *pDoc = getDoc(); + if (!pDoc) + return ERR_SWG_WRITE_ERROR; // Make sure the layout is available to have more stability in the output // markup. @@ -515,6 +517,12 @@ SwDoc* SwXMLExport::getDoc() if( m_pDoc != nullptr ) return m_pDoc; Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY ); + if (!xTextDoc) + { + SAL_WARN("sw.filter", "Problem of mismatching filter for export."); + return nullptr; + } + Reference < XText > xText = xTextDoc->getText(); Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY); assert( xTextTunnel.is()); |