tdf#163486: PVS: nullptr dereference

V595: The 'pMethod' pointer was utilized before it was verified against nullptr. Check lines: 392, 394.

Change-Id: I7c3cdcf9aacb76ca261733924dc238e836036433
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175080
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
This commit is contained in:
Xisco Fauli
2024-10-17 22:23:01 +02:00
parent 3bcf854a2f
commit 43cec3f814
+1 -1
View File
@@ -389,9 +389,9 @@ Sequence< OUString > GetMethodNames( const ScriptDocument& rDocument, const OUSt
for ( sal_uInt32 i = 0 ; i < nCount; ++i )
{
SbMethod* pMethod = static_cast<SbMethod*>(pMod->GetMethods()->Get(i));
assert(pMethod && "Method not found! (NULL)");
if( pMethod->IsHidden() )
continue;
assert(pMethod && "Method not found! (NULL)");
aSeqMethods.getArray()[ iTarget++ ] = pMethod->GetName();
}
}