From be55a1922a02e1c944d04526e4099e746f1bf8bb Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 20 Apr 2006 14:37:24 +0000 Subject: [PATCH] PAL12147. prevent from SIGSEGV when creating elements on NULL nodes --- src/SMDS/SMDS_Mesh.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.39.2