summaryrefslogtreecommitdiffstats
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-10-03 09:16:04 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-10-03 13:45:42 +0200
commit6534421e88c1edd245edfd4ca70dd4e6aa8be8e9 (patch)
tree92931bb280b4147dfc401b9596bb40bd762e3b73 /sd
parentUse closure to simplify use of for_each. (diff)
downloadcore-6534421e88c1edd245edfd4ca70dd4e6aa8be8e9.tar.gz
core-6534421e88c1edd245edfd4ca70dd4e6aa8be8e9.zip
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
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/docshell/docshell.cxx9
1 files changed, 6 insertions, 3 deletions
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;