[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Sep 20 06:32:26 UTC 2018


 sw/source/filter/xml/xmlexp.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 475ea37809b5bec369d02a5ab500fac46ab40f0a
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Wed Sep 12 21:37:43 2018 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Thu Sep 20 08:32:03 2018 +0200

    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 at yahoo.fr>

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());


More information about the Libreoffice-commits mailing list