Salome HOME
Rectangle correction to have coincidence with point/line selected for the first point...
[modules/shaper.git] / src / ModuleBase / ModuleBase_ResultPrs.cpp
index 2d08104de7177a6b9487db8085a198ce39d81ba4..3b32e56eef836e75c07ed6542088306ae578a01b 100755 (executable)
@@ -11,6 +11,8 @@
 #include <ModelAPI_ResultConstruction.h>
 #include <GeomAPI_PlanarEdges.h>
 
+#include <Events_Error.h>
+
 #include <BRep_Builder.hxx>
 #include <Prs3d_Drawer.hxx>
 #include <Prs3d.hxx>
@@ -72,8 +74,10 @@ void ModuleBase_ResultPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t
                                    const Standard_Integer theMode)
 {
   std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(myResult);
-  if (!aShapePtr)
+  if (!aShapePtr) {
+    Events_Error::throwException("An empty AIS presentation: ModuleBase_ResultPrs");
     return;
+  }
 
   if (myIsSketchMode) {
     myFacesList.clear();
@@ -94,6 +98,8 @@ void ModuleBase_ResultPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t
     ModuleBase_Tools::setDefaultDeviationCoefficient(myOriginalShape, Attributes());
     AIS_Shape::Compute(thePresentationManager, thePresentation, theMode);
   }
+  else
+    Events_Error::throwException("An empty AIS presentation: ModuleBase_ResultPrs");
 }