0025371: Visualization - raise exception in AIS_ConnectedInteractive::Connect() on...
authorkgv <kgv@opencascade.com>
Tue, 14 Oct 2014 15:17:11 +0000 (19:17 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 23 Oct 2014 12:20:37 +0000 (16:20 +0400)
Indicate API misuse by program exception.

src/AIS/AIS_ConnectedInteractive.cxx

index 31e3c51..f80bdc2 100644 (file)
@@ -35,6 +35,7 @@
 #include <Precision.hxx>
 #include <AIS_Drawer.hxx>
 #include <TopAbs_ShapeEnum.hxx>
+#include <Standard_ProgramError.hxx>
 #include <StdPrs_WFDeflectionShape.hxx>
 #include <StdPrs_HLRPolyShape.hxx>
 #include <Prs3d_Drawer.hxx>
@@ -86,6 +87,10 @@ void AIS_ConnectedInteractive::Connect (const Handle(AIS_InteractiveObject)& the
   {
     myReference = theAnotherObj;
   }
+  else
+  {
+    Standard_ProgramError::Raise ("AIS_ConnectedInteractive::Connect() - object without own presentation can not be connected");
+  }
 
   if (!myReference.IsNull())
   {