sw/source/filter/xml/xmlexp.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 6920e84063ba52955d0edb2169aa4c728881397e
Author:     Xisco Fauli <[email protected]>
AuthorDate: Fri Jan 23 11:28:06 2026 +0100
Commit:     Xisco Fauli <[email protected]>
CommitDate: Fri Jan 23 16:21:05 2026 +0100

    crashreporting: check xTextDoc in ExportContent_()
    
    Seen in 
https://crashreport.libreoffice.org/stats/crash_details/b4091e21-8d8c-48e8-818b-f05ac0aff040
    
    Change-Id: If5aaf56724331ec92c85dac2f8b5ce4ba55e4143
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197935
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index ca6996f9168d..a523c49a79d2 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -539,11 +539,14 @@ void SwXMLExport::ExportContent_()
 
     GetTextParagraphExport()->exportTrackedChanges( false );
     GetTextParagraphExport()->exportTextDeclarations();
-    Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
-    Reference < XText > xText = xTextDoc->getText();
-
     GetTextParagraphExport()->exportFramesBoundToPage( m_bShowProgress );
-    GetTextParagraphExport()->exportText( xText, m_bShowProgress );
+
+    Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
+    if (xTextDoc.is())
+    {
+        Reference < XText > xText = xTextDoc->getText();
+        GetTextParagraphExport()->exportText( xText, m_bShowProgress );
+    }
 }
 
 SwDoc* SwXMLExport::getDoc()

Reply via email to