sw/source/core/access/AccessibilityCheck.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit e66f6f7765ba7855df65deea94ecb0aaefc8488a
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Thu Oct 3 15:14:05 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Fri Oct 4 09:29:40 2024 +0200

    check for null DocShell before deref
    
    an effort to fix:
    
https://crashreport.libreoffice.org/stats/signature/static%20void%20sw::%60anonymous%20namespace'::TextFormattingCheck::check(class%20SwNode%20*)
    
    Change-Id: I5adb0a1c244ec3372bd58e5a5493cbce80684ae1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174425
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Tested-by: Jenkins
    (cherry picked from commit c5f4fe10589acff4d253cc3d32acaf67c7456bd7)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174444

diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index ff7a6b1b2d3c..df4a710ecf9c 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -1348,7 +1348,12 @@ public:
             return;
 
         SwTextNode* pTextNode = pCurrent->GetTextNode();
-        SwWrtShell* pWrtShell = 
pTextNode->GetDoc().GetDocShell()->GetWrtShell();
+
+        SwDocShell* pDocShell = pTextNode->GetDoc().GetDocShell();
+        if (!pDocShell)
+            return;
+
+        SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
         if (pWrtShell && !pTextNode->getLayoutFrame(pWrtShell->GetLayout()))
             return;
 

Reply via email to