From 6534421e88c1edd245edfd4ca70dd4e6aa8be8e9 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 3 Oct 2016 09:16:04 +0200 Subject: sd: mpViewShell can be nullptr in DrawDocShell::GetState() Start Impress, e.g. go to Tools -> Macros -> Organize macros -> Basic, then start editing a macro -> crash. Change-Id: Ie54a3467e0121c9f87834129ba89fe6485fea552 --- sd/source/ui/docshell/docshell.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx index 843235c4b018..c9ee2b62c7c9 100644 --- a/sd/source/ui/docshell/docshell.cxx +++ b/sd/source/ui/docshell/docshell.cxx @@ -274,9 +274,12 @@ void DrawDocShell::GetState(SfxItemSet &rSet) case SID_NOTEBOOKBAR: { - bool bVisible = sfx2::SfxNotebookBar::StateMethod(mpViewShell->GetFrame()->GetBindings(), - "modules/simpress/ui/"); - rSet.Put( SfxBoolItem( SID_NOTEBOOKBAR, bVisible ) ); + if (mpViewShell) + { + bool bVisible = sfx2::SfxNotebookBar::StateMethod(mpViewShell->GetFrame()->GetBindings(), + "modules/simpress/ui/"); + rSet.Put( SfxBoolItem( SID_NOTEBOOKBAR, bVisible ) ); + } } break; -- cgit