diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-11-18 15:31:34 +0000 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-11-18 22:14:25 +0100 |
commit | 8443576d96346b63e3c2f11f258d2b89c3538f9e (patch) | |
tree | 08a4c40f3e851b4de4efbbf3f6f69d8f573e164c /sw | |
parent | 48e947333b51b3834eec21ccb0793bd7f5d589d7 (diff) |
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 <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
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); } |