]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Debug of C. Bourcier
authorageay <ageay>
Tue, 2 Apr 2013 06:28:11 +0000 (06:28 +0000)
committerageay <ageay>
Tue, 2 Apr 2013 06:28:11 +0000 (06:28 +0000)
src/MEDLoader/SauvMedConvertor.cxx

index 1ce5d818c9e790ca34a4e15254bbeca2dbeda652..246e4bef01242c9b882ad57607d86a3971ce70fc 100644 (file)
@@ -1577,9 +1577,16 @@ void IntermediateMED::orientFaces3D()
                               if ( lfIt2 != linkFacesMap.end() )
                                 {
                                   list<const Cell*> & ff = lfIt2->second;
-                                  ff.erase( find( ff.begin(), ff.end(), badFace ));
-                                  if ( ff.empty() )
-                                    linkFacesMap.erase( lfIt2 );
+                                  list<const Cell*>::iterator lfIt3 = find( ff.begin(), ff.end(), badFace );
+                                  // check if badFace has been found,
+                                  // else we can't erase it
+                                  // case of degenerated face in edge
+                                  if (lfIt3 != ff.end())
+                                    {
+                                      ff.erase( lfIt3 );
+                                      if ( ff.empty() )
+                                        linkFacesMap.erase( lfIt2 );
+                                    }
                                 }
                             }
                           badFace->_reverse = true; // reverse