From b554232bcbaf20513fc527a878055440ff7cf2a3 Mon Sep 17 00:00:00 2001 From: asl Date: Wed, 27 May 2015 09:33:47 +0300 Subject: [PATCH] refs #557: patch for crash if null object is passed to HYDROGUI shape --- src/HYDROGUI/HYDROGUI_Shape.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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() -- 2.39.2