]> SALOME platform Git repositories - plugins/ghs3dplugin.git/commitdiff
Salome HOME
Additional protection in method Evaluate().
authorskl <skl@opencascade.com>
Tue, 25 Aug 2009 07:49:25 +0000 (07:49 +0000)
committerskl <skl@opencascade.com>
Tue, 25 Aug 2009 07:49:25 +0000 (07:49 +0000)
src/GHS3DPlugin_GHS3D.cxx

index 2bdc33c1bf8cbb13ab9898ac2ec2008cb6d4dc5e..c0befee8ab29313ce476d7fbca997e9f723fe76a 100644 (file)
@@ -1752,6 +1752,12 @@ bool GHS3DPlugin_GHS3D::Evaluate(SMESH_Mesh& aMesh,
     TopoDS_Face F = TopoDS::Face( exp.Current() );
     SMESH_subMesh *sm = aMesh.GetSubMesh(F);
     MapShapeNbElemsItr anIt = aResMap.find(sm);
+    if( anIt==aResMap.end() ) {
+      SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
+      smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,
+                                           "Submesh can not be evaluated",this));
+      return false;
+    }
     std::vector<int> aVec = (*anIt).second;
     nbtri += Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
     nbqua += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);