diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-05-13 20:41:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-15 10:21:23 +0100 |
commit | 9f09218d4e9f931e8d2d519872a5fe72f06f529b (patch) | |
tree | dd7c93e2edfc3734325ba08ddaab0955f085f9d0 /framework/source | |
parent | 0ac3a94c9f7bffe27ec1e07c4cc73cf2425b3898 (diff) |
coverity#441006 Dereference null return value
Change-Id: I6c00db53ce507dacbf6032dbe4d41d806740be62
Diffstat (limited to 'framework/source')
-rw-r--r-- | framework/source/uielement/toolbarsmenucontroller.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index cca476f6796d..5321064ef9d9 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -445,9 +445,10 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r { SolarMutexGuard aGuard; VCLXPopupMenu* pXPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( m_xPopupMenu ); - PopupMenu* pVCLPopupMenu = (PopupMenu *)pXPopupMenu->GetMenu(); - - pVCLPopupMenu->SetUserValue( nIndex, sal_uIntPtr( aSortedTbs[i].bContextSensitive ? 1L : 0L )); + PopupMenu* pVCLPopupMenu = pXPopupMenu ? (PopupMenu *)pXPopupMenu->GetMenu() : NULL; + assert(pVCLPopupMenu); + if (pVCLPopupMenu) + pVCLPopupMenu->SetUserValue( nIndex, sal_uIntPtr( aSortedTbs[i].bContextSensitive ? 1L : 0L )); } // use VCL popup menu pointer to set vital information that are not part of the awt implementation |