summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@collabora.com>2019-06-13 13:19:05 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2019-06-13 19:41:32 +0200
commitc98b7c9e75a951012d6693f5adecb1ff0e1f8f6b (patch)
treed1d0964d5079fb0f3c27ed46d97bfdc786e4762b
parent7f89fe721d2b74ad88b5a124cda20ae419746dec (diff)
Resolves tdf#125840: Crash when trying to customize Base Data View toolbar
Change-Id: If5b157c1f1362128d22d210286da741ba905e5aa Reviewed-on: https://gerrit.libreoffice.org/73958 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r--cui/source/customize/SvxMenuConfigPage.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx
index bf0247ca5f2c..03e3f9ac046d 100644
--- a/cui/source/customize/SvxMenuConfigPage.cxx
+++ b/cui/source/customize/SvxMenuConfigPage.cxx
@@ -223,10 +223,14 @@ void SvxMenuConfigPage::UpdateButtonStates()
{
SvxConfigEntry* pMenuData = GetTopLevelSelection();
PopupMenu* pGearPopup = m_pGearBtn->GetPopupMenu();
+
+ if (!pGearPopup)
+ return;
+
// Add option (gear_add) will always be enabled
- pGearPopup->EnableItem( "gear_delete", pMenuData->IsDeletable() );
- pGearPopup->EnableItem( "gear_rename", pMenuData->IsRenamable() );
- pGearPopup->EnableItem( "gear_move", pMenuData->IsMovable() );
+ pGearPopup->EnableItem( "gear_delete", pMenuData && pMenuData->IsDeletable() );
+ pGearPopup->EnableItem( "gear_rename", pMenuData && pMenuData->IsRenamable() );
+ pGearPopup->EnableItem( "gear_move", pMenuData && pMenuData->IsMovable() );
}
}