coverity#1209554 Explicit null dereferenced

Change-Id: Iacf4373221b93a97e030b09501cc91589f2fdff7
This commit is contained in:
Caolán McNamara
2014-05-07 11:19:09 +01:00
parent 3e423ebe1c
commit 148b9a23fa

View File

@@ -1136,7 +1136,6 @@ OUString EditorWindow::GetActualSubName( sal_uLong nLine )
for( sal_uInt16 i=0; i < pMethods->Count(); i++ ) for( sal_uInt16 i=0; i < pMethods->Count(); i++ )
{ {
SbxVariable* p = PTR_CAST( SbMethod, pMethods->Get( i ) ); SbxVariable* p = PTR_CAST( SbMethod, pMethods->Get( i ) );
OUString sName = p->GetName();
SbMethod* pMeth = p ? PTR_CAST( SbMethod, p ) : NULL; SbMethod* pMeth = p ? PTR_CAST( SbMethod, p ) : NULL;
if( pMeth ) if( pMeth )
{ {
@@ -1144,7 +1143,7 @@ OUString EditorWindow::GetActualSubName( sal_uLong nLine )
pMeth->GetLineRange(l1,l2); pMeth->GetLineRange(l1,l2);
if( (l1 <= nLine+1) && (nLine+1 <= l2) ) if( (l1 <= nLine+1) && (nLine+1 <= l2) )
{ {
return sName; return pMeth->GetName();
} }
} }
} }