From: eap Date: Wed, 16 Nov 2005 15:00:03 +0000 (+0000) Subject: PAL10515. Check shape type before calling TopoDS::Face() X-Git-Tag: V3_1_0a3~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a5e3cc49d703c008b20d1ba71858a4d5164210c5;p=modules%2Fsmesh.git PAL10515. Check shape type before calling TopoDS::Face() --- diff --git a/src/SMESH_I/SMESH_Pattern_i.cxx b/src/SMESH_I/SMESH_Pattern_i.cxx index e8da5c8d1..887dfe51f 100644 --- a/src/SMESH_I/SMESH_Pattern_i.cxx +++ b/src/SMESH_I/SMESH_Pattern_i.cxx @@ -131,8 +131,8 @@ CORBA::Boolean SMESH_Pattern_i::LoadFromFace(SMESH::SMESH_Mesh_ptr theMesh, if ( !aMesh ) return false; - TopoDS_Face aFace = TopoDS::Face( myGen->GeomObjectToShape( theFace )); - if ( aFace.IsNull() ) + TopoDS_Shape aFace = myGen->GeomObjectToShape( theFace ); + if ( aFace.IsNull() || aFace.ShapeType() != TopAbs_FACE ) return false; // Update Python script @@ -143,7 +143,7 @@ CORBA::Boolean SMESH_Pattern_i::LoadFromFace(SMESH::SMESH_Mesh_ptr theMesh, SMESH_Gen_i::AddToCurrentPyScript( str ); addErrorCode( "LoadFromFace" ); - return myPattern.Load( aMesh, aFace, theProject ); + return myPattern.Load( aMesh, TopoDS::Face( aFace ), theProject ); } //=======================================================================