]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #557: patch for crash if null object is passed to HYDROGUI shape
authorasl <asl@opencascade.com>
Wed, 27 May 2015 06:33:47 +0000 (09:33 +0300)
committerasl <asl@opencascade.com>
Wed, 27 May 2015 06:33:47 +0000 (09:33 +0300)
src/HYDROGUI/HYDROGUI_Shape.cxx

index f9799da5530056ac4be7f9a127f7820cf30437a9..c430bb5163bfcc962ed867f22361ca8b43c155b8 100644 (file)
@@ -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()