summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-01-11 11:15:55 +0000
committerMichael Stahl <michael.stahl@allotropia.de>2021-01-12 11:08:48 +0100
commit2f043f2d5b7b7ccd4790c9125ff56254313c1a84 (patch)
treee268dd631b0dc8879a2baa526e3a910b8d29f98b /sd
parent3745df317f500e95a301f0a883111ec2c7f06405 (diff)
rhbz#1902708 null deref
Change-Id: I718ac8a59e5cb18c840e458de8e9f877c6449fd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109005 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 8144a1dd4155..7ee164ac09d3 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -921,7 +921,9 @@ void SdPageObjsTLV::SetSdNavigator(SdNavigatorWin* pNavigator)
void SdPageObjsTLV::SetViewFrame(const SfxViewFrame* pViewFrame)
{
sd::ViewShellBase* pBase = sd::ViewShellBase::GetViewShellBase(pViewFrame);
- const css::uno::Reference< css::frame::XFrame > xFrame = pBase->GetMainViewShell()->GetViewFrame()->GetFrame().GetFrameInterface();
+ std::shared_ptr<sd::ViewShell> xViewShell = pBase->GetMainViewShell();
+ SAL_WARN_IF(!xViewShell, "sd", "null pBaseViewFrame");
+ const css::uno::Reference< css::frame::XFrame > xFrame = xViewShell ? xViewShell->GetViewFrame()->GetFrame().GetFrameInterface() : nullptr;
m_xAccel->init(::comphelper::getProcessComponentContext(), xFrame);
}