diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-01-11 11:15:55 +0000 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-01-12 11:08:39 +0100 |
commit | cbfafd41319ddf2bc42d2c84924512b66dee4d2d (patch) | |
tree | 869512e90733cac62b749fb69c4c5030e17ebf8c | |
parent | 9176d828cb84bb6f74712972f1f21e2f446c5e9d (diff) |
rhbz#1902708 null deref
Change-Id: I718ac8a59e5cb18c840e458de8e9f877c6449fd8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109004
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r-- | sd/source/ui/dlg/sdtreelb.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 780f8a6ce35b..0ccab4448e88 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -926,7 +926,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); } |