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

index 0af8d4fc04c85881b33bfc3a269887aa2490bafd..42c6129c86608a136fddf4458423f90c02c3bff8 100644 (file)
@@ -683,6 +683,12 @@ bool NETGENPlugin_NETGEN_3D::Evaluate(SMESH_Mesh& aMesh,
     tmpMap.Add(E);
     SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current());
     MapShapeNbElemsItr anIt = aResMap.find(aSubMesh);
+    if( anIt==aResMap.end() ) {
+      SMESH_ComputeErrorPtr& smError = aSubMesh->GetComputeError();
+      smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,
+                                           "Submesh can not be evaluated",this));
+      return false;
+    }
     std::vector<int> aVec = (*anIt).second;
     nb0d_e += aVec[SMDSEntity_Node];
     nb1d_e += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);