summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-05-13 20:39:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-05-15 10:21:22 +0100
commit0ac3a94c9f7bffe27ec1e07c4cc73cf2425b3898 (patch)
tree2a50912bb7ebf0f20ae2f34e8932e33a5656a437 /framework
parent9831dc20ab35bfe962f35d9033a3812be745a958 (diff)
coverity#440876 Dereference null return value
Change-Id: I7d00c3a3c1a12176e4b1ab74712aabeb2f1cf90e
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/toolbarsmenucontroller.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx
index a90b59790a78..cca476f6796d 100644
--- a/framework/source/uielement/toolbarsmenucontroller.cxx
+++ b/framework/source/uielement/toolbarsmenucontroller.cxx
@@ -556,7 +556,11 @@ void SAL_CALL ToolbarsMenuController::statusChanged( const FeatureStateEvent& Ev
{
SolarMutexGuard aGuard;
VCLXPopupMenu* pXPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( xPopupMenu );
- PopupMenu* pVCLPopupMenu = (PopupMenu *)pXPopupMenu->GetMenu();
+ PopupMenu* pVCLPopupMenu = pXPopupMenu ? (PopupMenu *)pXPopupMenu->GetMenu() : NULL;
+
+ assert(pVCLPopupMenu);
+ if (!pVCLPopupMenu)
+ return;
for ( sal_uInt16 i = 0; i < pVCLPopupMenu->GetItemCount(); i++ )
{