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

New commits:
commit c5f4fe10589acff4d253cc3d32acaf67c7456bd7
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Thu Oct 3 15:14:05 2024 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Oct 3 23:37:51 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

diff --git a/sw/source/core/access/AccessibilityCheck.cxx 
b/sw/source/core/access/AccessibilityCheck.cxx
index 04ef133f8e7e..2b6cce2107c8 100644
--- a/sw/source/core/access/AccessibilityCheck.cxx
+++ b/sw/source/core/access/AccessibilityCheck.cxx
@@ -1548,7 +1548,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