From: ptv Date: Mon, 26 Jun 2006 11:11:53 +0000 (+0000) Subject: add check of predicate pointer before usage X-Git-Tag: LAST_STABLE_VERSION_21_09_2006_ON_3_2_0~21 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5f87b237eabcf9deeedad4c078788679d5e5da45;p=modules%2Fsmesh.git add check of predicate pointer before usage --- diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index 917732d62..0a95dfff0 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -1784,7 +1784,8 @@ GetElementsId( Predicate_i* thePredicate, const SMDS_Mesh* theMesh, Controls::Filter::TIdSequence& theSequence ) { - Controls::Filter::GetElementsId(theMesh,thePredicate->GetPredicate(),theSequence); + if (thePredicate) + Controls::Filter::GetElementsId(theMesh,thePredicate->GetPredicate(),theSequence); } void @@ -1793,8 +1794,9 @@ GetElementsId( Predicate_i* thePredicate, SMESH_Mesh_ptr theMesh, Controls::Filter::TIdSequence& theSequence ) { - if(const SMDS_Mesh* aMesh = MeshPtr2SMDSMesh(theMesh)) - Controls::Filter::GetElementsId(aMesh,thePredicate->GetPredicate(),theSequence); + if (thePredicate) + if(const SMDS_Mesh* aMesh = MeshPtr2SMDSMesh(theMesh)) + Controls::Filter::GetElementsId(aMesh,thePredicate->GetPredicate(),theSequence); } SMESH::long_array* @@ -1802,7 +1804,7 @@ Filter_i:: GetElementsId( SMESH_Mesh_ptr theMesh ) { SMESH::long_array_var anArray = new SMESH::long_array; - if(!CORBA::is_nil(theMesh)){ + if(!CORBA::is_nil(theMesh) && myPredicate){ Controls::Filter::TIdSequence aSequence; GetElementsId(myPredicate,theMesh,aSequence); long i = 0, iEnd = aSequence.size();