From d9c6fa0c31e25268829ec83d8d7a304abceeaaba Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 18 Nov 2021 15:31:34 +0000 Subject: crashes seen in WriterInspectorTextPanel ctor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit null DocSh is likely Change-Id: I5aeb81ef01795b896ad594d7eb7f0cd657f5a690 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125483 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(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 aStore; - if (pDocSh->GetDoc()->GetEditShell()->GetCursor()->GetNode().GetTextNode()) + if (pDocSh && pDocSh->GetDoc()->GetEditShell()->GetCursor()->GetNode().GetTextNode()) UpdateTree(pDocSh, aStore); updateEntries(aStore); } -- cgit