From: eap Date: Thu, 20 Apr 2006 14:37:24 +0000 (+0000) Subject: PAL12147. prevent from SIGSEGV when creating elements on NULL nodes X-Git-Tag: T3_2_0b1_pre1~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=be55a1922a02e1c944d04526e4099e746f1bf8bb;p=modules%2Fsmesh.git PAL12147. prevent from SIGSEGV when creating elements on NULL nodes --- diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index d9a281d44..acb74c7bc 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -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; }