summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-18 15:31:34 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-11-19 10:57:49 +0100
commitd9c6fa0c31e25268829ec83d8d7a304abceeaaba (patch)
treecbda21fdf33dad13ba895d622dfb8c6dd6054d14 /sw
parent10d172747ba44b405e4bf4cfe7142a23a51bb94e (diff)
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 <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx4
1 files 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<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);
}