summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-28 09:39:30 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-01-28 11:29:20 +0000
commit7b52b96a6f742952d7b4c57a60aee494a2e25cde (patch)
tree1cdd793705ab03e2839676326476669eb2bf35b0 /toolkit
parent0ee169f7833684c8ef16df259029cc169119f6f1 (diff)
coverity#440874 Dereference before null check
Change-Id: I542da40fe1209198ea784cf52372cd6d83292f33
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxmenu.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index ab25dfdf518a..400b10b98860 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -365,8 +365,11 @@ throw(css::uno::RuntimeException)
SolarMutexGuard aSolarGuard;
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ if (!mpMenu)
+ return;
+
sal_Int32 nItemCount = (sal_Int32)mpMenu->GetItemCount();
- if ( mpMenu && ( nCount > 0 ) && ( nPos >= 0 ) && ( nPos < nItemCount ) && ( nItemCount > 0 ))
+ if ( ( nCount > 0 ) && ( nPos >= 0 ) && ( nPos < nItemCount ) && ( nItemCount > 0 ))
{
sal_Int16 nP = sal::static_int_cast< sal_Int16 >(
std::min( (int)(nPos+nCount), (int)nItemCount ));