Salome HOME
Issue #348 Validate sketch is disabled when point coordinates are set manually
[modules/shaper.git] / 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);