From 43cec3f814e509a257eec597baf8bbeb568eb7d9 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Thu, 17 Oct 2024 13:52:00 +0200 Subject: [PATCH] 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 Tested-by: Jenkins --- basctl/source/basicide/basobj2.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx index 1cb6f23fe2b3..48c09c039388 100644 --- a/basctl/source/basicide/basobj2.cxx +++ b/basctl/source/basicide/basobj2.cxx @@ -389,9 +389,9 @@ Sequence< OUString > GetMethodNames( const ScriptDocument& rDocument, const OUSt for ( sal_uInt32 i = 0 ; i < nCount; ++i ) { SbMethod* pMethod = static_cast(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(); } }