]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Check ShapePtr on validity
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 9 Jun 2014 12:37:33 +0000 (16:37 +0400)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 9 Jun 2014 12:37:33 +0000 (16:37 +0400)
src/XGUI/XGUI_Displayer.cpp

index e588367b897b043689c92600aee7b6aa97b29f9a..ae0ff21bb633159bbadc1fe14a79cc026fefa068 100644 (file)
@@ -186,13 +186,14 @@ void XGUI_Displayer::redisplay(FeaturePtr theFeature, bool isUpdateViewer)
   if (!isVisible(aFeature))
     return;
 
-  Handle(AIS_InteractiveObject) aAISObj = getAISObject(aFeature);
   boost::shared_ptr<GeomAPI_Shape> aShapePtr = aFeature->data()->shape();
+  if (aShapePtr) {
+    Handle(AIS_InteractiveObject) aAISObj = getAISObject(aFeature);
+    Handle(AIS_Shape) aAISShape = Handle(AIS_Shape)::DownCast(aAISObj);
+    aAISShape->Set(aShapePtr->impl<TopoDS_Shape>());
 
-  Handle(AIS_Shape) aAISShape = Handle(AIS_Shape)::DownCast(aAISObj);
-  aAISShape->Set(aShapePtr->impl<TopoDS_Shape>());
-
-  AISContext()->Redisplay(aAISShape);
+    AISContext()->Redisplay(aAISShape);
+  }
 }
 
 void XGUI_Displayer::activateInLocalContext(FeaturePtr theFeature,