summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-09-12 21:37:43 +0200
committerJulien Nabet <serval2412@yahoo.fr>2018-09-20 08:32:03 +0200
commit475ea37809b5bec369d02a5ab500fac46ab40f0a (patch)
tree8c56148a63c7bcc80af540bb96a28222e6ce56bb /sw
parent6d0d6a875867c823603f5947f7a035601042f903 (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 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/xml/xmlexp.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index c983e8f93ac8..99bba3d0d05b 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -124,6 +124,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.
@@ -514,6 +516,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());