From 9b0c4607d0cf2103c096b9571af184ac7a6cc11d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 11 Jan 2021 11:15:55 +0000 Subject: rhbz#1902708 null deref MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I718ac8a59e5cb18c840e458de8e9f877c6449fd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109087 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sd/source/ui/dlg/sdtreelb.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index fadcd450b170..98542f75cdfa 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -945,7 +945,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 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); } -- cgit