coverity#440876 Dereference null return value

Change-Id: I7d00c3a3c1a12176e4b1ab74712aabeb2f1cf90e
This commit is contained in:
Caolán McNamara 2014-05-13 20:39:53 +01:00
parent 9831dc20ab
commit 0ac3a94c9f

View File

@ -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++ )
{