]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for crash of double-click in one point during creation of linear segment in a...
authormpv <mpv@opencascade.com>
Mon, 19 Jan 2015 16:40:36 +0000 (19:40 +0300)
committermpv <mpv@opencascade.com>
Mon, 19 Jan 2015 16:40:36 +0000 (19:40 +0300)
src/XGUI/XGUI_Displayer.cpp

index a8f9dcad990baa4b7a0fe56252615dd0231c3458..8dd2d2e25f8388fe9bfa1a9a30b20ec45e2a5d23 100644 (file)
@@ -217,12 +217,14 @@ void XGUI_Displayer::redisplay(ObjectPtr theObject, bool isUpdateViewer)
       Handle(AIS_Shape) aShapePrs = Handle(AIS_Shape)::DownCast(aAISIO);
       if (!aShapePrs.IsNull()) {
         std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(aResult);
-        const TopoDS_Shape& aShape = aShapePrs->Shape();
-        std::shared_ptr<GeomAPI_Shape> anAISShapePtr(new GeomAPI_Shape());
-        anAISShapePtr->setImpl(new TopoDS_Shape(aShape));
+        if (aShapePtr.get()) {
+          const TopoDS_Shape& aShape = aShapePrs->Shape();
+          std::shared_ptr<GeomAPI_Shape> anAISShapePtr(new GeomAPI_Shape());
+          anAISShapePtr->setImpl(new TopoDS_Shape(aShape));
 
-        if (aShapePtr->isEqual(anAISShapePtr))
-          return;
+          if (aShapePtr->isEqual(anAISShapePtr))
+            return;
+        }
       }
     }
     aContext->Redisplay(aAISIO, false);