diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-01 14:24:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-01 14:41:33 +0100 |
commit | d176c0f3040743d470976bf99cbcc5a7b864e50e (patch) | |
tree | 74dec089e6889af7fae1eb23c7668bb4cb5a9cbe /sfx2 | |
parent | 5e6d41ddcf705fd71129c07b1c990d0f99f384b6 (diff) |
coverity#1325256 Dereference null return value
Change-Id: If4ae66b8f6aef172c5e616d94f9d804b72d3a774
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index e2498e76b990..33c96235379d 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2556,9 +2556,9 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const OUString& sMacro ) if ( pBasic ) { SbModule* pModule = pBasic->FindModule( aModuleName ); - if ( pModule ) + SbMethod* pMethod = pModule ? static_cast<SbMethod*>(pModule->GetMethods()->Find(aMacroName, SbxCLASS_METHOD)) : nullptr; + if (pMethod) { - SbMethod* pMethod = static_cast<SbMethod*>(pModule->GetMethods()->Find( aMacroName, SbxCLASS_METHOD )); aOUSource = pModule->GetSource32(); sal_uInt16 nStart, nEnd; pMethod->GetLineRange( nStart, nEnd ); |