From: asl Date: Wed, 27 May 2015 06:33:47 +0000 (+0300) Subject: refs #557: patch for crash if null object is passed to HYDROGUI shape X-Git-Tag: v1.4.1~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b554232bcbaf20513fc527a878055440ff7cf2a3;p=modules%2Fhydro.git refs #557: patch for crash if null object is passed to HYDROGUI shape --- diff --git a/src/HYDROGUI/HYDROGUI_Shape.cxx b/src/HYDROGUI/HYDROGUI_Shape.cxx index f9799da5..c430bb51 100644 --- a/src/HYDROGUI/HYDROGUI_Shape.cxx +++ b/src/HYDROGUI/HYDROGUI_Shape.cxx @@ -478,13 +478,13 @@ Handle_AIS_InteractiveObject HYDROGUI_Shape::createShape() const { if( myTopoShape.IsNull() ) return Handle_AIS_InteractiveObject(); - else - if ( myObject->IsKind( STANDARD_TYPE(HYDROData_PolylineXY) ) || - myObject->IsKind( STANDARD_TYPE(HYDROData_Polyline3D)) || - myObject->IsKind( STANDARD_TYPE(HYDROData_Profile) )) - return new HYDROGUI_Polyline(myTopoShape); - else - return new AIS_Shape( myTopoShape ); + + TopAbs_ShapeEnum aShapeType = myTopoShape.ShapeType(); + if ( aShapeType==TopAbs_EDGE || aShapeType==TopAbs_WIRE ) { + return new HYDROGUI_Polyline( myTopoShape ); + } else { + return new AIS_Shape( myTopoShape ); + } } void HYDROGUI_Shape::buildShape()