From: gdd Date: Thu, 12 May 2011 15:32:46 +0000 (+0000) Subject: Fix crash of Salome in case of reading GMF files. X-Git-Tag: V6_3_0~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=daaebaa29a22c26c009bcdf657e09a23d41071fb;p=plugins%2Fghs3dplugin.git Fix crash of Salome in case of reading GMF files. --- diff --git a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx index 6a7df36..c7d3fdc 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx @@ -1280,7 +1280,7 @@ static bool readGMFFile(const char* theFile, case GmfEdges: if (fullyCreatedElement) { aCreatedElem = theHelper->AddEdge( node[0], node[1], /*id =*/0, /*force3d =*/false ); - if (!anEdgeGroupByGhs3dId[iElem].empty()) + if (anEdgeGroupByGhs3dId.size() && !anEdgeGroupByGhs3dId[iElem].empty()) updateMeshGroups(theHelper->GetMesh(), aCreatedElem, anEdgeGroupByGhs3dId[iElem]); } break; @@ -1289,7 +1289,7 @@ static bool readGMFFile(const char* theFile, aCreatedElem = theHelper->AddFace( node[0], node[1], node[2], /*id =*/0, /*force3d =*/false ); for ( int iRef = 0; iRef < nbRef; iRef++ ) nodeAssigne[ nodeID[ iRef ]] = 1; - if (!aFaceGroupByGhs3dId[iElem].empty()) + if (aFaceGroupByGhs3dId.size() && !aFaceGroupByGhs3dId[iElem].empty()) updateMeshGroups(theHelper->GetMesh(), aCreatedElem, aFaceGroupByGhs3dId[iElem]); } break;