sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8443576d96346b63e3c2f11f258d2b89c3538f9e
Author:     Caolán McNamara <[email protected]>
AuthorDate: Thu Nov 18 15:31:34 2021 +0000
Commit:     Xisco Fauli <[email protected]>
CommitDate: Thu Nov 18 22:14:25 2021 +0100

    crashes seen in WriterInspectorTextPanel ctor
    
    null DocSh is likely
    
    Change-Id: I5aeb81ef01795b896ad594d7eb7f0cd657f5a690
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125451
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx 
b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index a59143ba8d48..5d55176be2da 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -62,7 +62,7 @@ 
WriterInspectorTextPanel::WriterInspectorTextPanel(weld::Widget* pParent)
     : InspectorTextPanel(pParent)
 {
     SwDocShell* pDocSh = static_cast<SwDocShell*>(SfxObjectShell::Current());
-    m_pShell = pDocSh->GetWrtShell();
+    m_pShell = pDocSh ? pDocSh->GetWrtShell() : nullptr;
     if (m_pShell)
     {
         m_oldLink = m_pShell->GetChgLnk();
@@ -71,7 +71,7 @@ 
WriterInspectorTextPanel::WriterInspectorTextPanel(weld::Widget* pParent)
 
     // Update panel on start
     std::vector<svx::sidebar::TreeNode> aStore;
-    if (pDocSh->GetDoc()->GetEditShell()->GetCursor()->GetNode().GetTextNode())
+    if (pDocSh && 
pDocSh->GetDoc()->GetEditShell()->GetCursor()->GetNode().GetTextNode())
         UpdateTree(pDocSh, aStore);
     updateEntries(aStore);
 }

Reply via email to