Salome HOME
protect GetSubShapeByNode() from SIGSEGV at NULL node
authoreap <eap@opencascade.com>
Wed, 10 Oct 2012 10:44:55 +0000 (10:44 +0000)
committereap <eap@opencascade.com>
Wed, 10 Oct 2012 10:44:55 +0000 (10:44 +0000)
src/SMESH/SMESH_MesherHelper.cxx

index ffca47e6aa48d5dc3a864f35b634f2bbde2707d7..60d202870cda4ff3f7ee87df0616f084a24d19b1 100644 (file)
@@ -329,7 +329,7 @@ bool SMESH_MesherHelper::IsMedium(const SMDS_MeshNode*      node,
 TopoDS_Shape SMESH_MesherHelper::GetSubShapeByNode(const SMDS_MeshNode* node,
                                                    const SMESHDS_Mesh*  meshDS)
 {
-  int shapeID = node->getshapeId();
+  int shapeID = node ? node->getshapeId() : 0;
   if ( 0 < shapeID && shapeID <= meshDS->MaxShapeIndex() )
     return meshDS->IndexToShape( shapeID );
   else