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

New commits:
commit d9c6fa0c31e25268829ec83d8d7a304abceeaaba
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Nov 18 15:31:34 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Nov 19 10:57:49 2021 +0100

    crashes seen in WriterInspectorTextPanel ctor
    
    null DocSh is likely
    
    Change-Id: I5aeb81ef01795b896ad594d7eb7f0cd657f5a690
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125483
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx 
b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index 48c2de119311..b0a0258864c5 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