PAL12147. prevent from SIGSEGV when creating elements on NULL nodes

This commit is contained in:
eap 2006-04-20 14:37:24 +00:00
parent d198800332
commit be55a1922a

View File

@ -195,7 +195,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
{
SMDS_MeshFace * face=createTriangle(n1, n2, n3);
if (!registerElement(ID, face)) {
if (face && !registerElement(ID, face)) {
RemoveElement(face, false);
face = NULL;
}
@ -246,7 +246,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1,
{
SMDS_MeshFace * face=createQuadrangle(n1, n2, n3, n4);
if (!registerElement(ID, face)) {
if (face && !registerElement(ID, face)) {
RemoveElement(face, false);
face = NULL;
}