From bf83ff992055ef137a93e4e9ed4ae84a6485185d Mon Sep 17 00:00:00 2001 From: ageay Date: Tue, 2 Apr 2013 06:28:11 +0000 Subject: [PATCH] Debug of C. Bourcier --- src/MEDLoader/SauvMedConvertor.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/MEDLoader/SauvMedConvertor.cxx b/src/MEDLoader/SauvMedConvertor.cxx index 1ce5d818c..246e4bef0 100644 --- a/src/MEDLoader/SauvMedConvertor.cxx +++ b/src/MEDLoader/SauvMedConvertor.cxx @@ -1577,9 +1577,16 @@ void IntermediateMED::orientFaces3D() if ( lfIt2 != linkFacesMap.end() ) { list & ff = lfIt2->second; - ff.erase( find( ff.begin(), ff.end(), badFace )); - if ( ff.empty() ) - linkFacesMap.erase( lfIt2 ); + list::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 -- 2.39.2