From daaebaa29a22c26c009bcdf657e09a23d41071fb Mon Sep 17 00:00:00 2001 From: gdd Date: Thu, 12 May 2011 15:32:46 +0000 Subject: [PATCH] Fix crash of Salome in case of reading GMF files. --- src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.39.2