]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Workaround for issues #667, 668, 670
authornds <natalia.donis@opencascade.com>
Tue, 23 Jun 2015 08:07:33 +0000 (11:07 +0300)
committernds <natalia.donis@opencascade.com>
Tue, 23 Jun 2015 08:07:33 +0000 (11:07 +0300)
src/SketcherPrs/SketcherPrs_SensitivePoint.cpp

index fa091f9a75822e7d1b4e2a6f9dffed5350b8fe11..26e5d6b5169265cde144a5c87caf8733e34728b3 100644 (file)
@@ -39,11 +39,15 @@ Standard_Boolean SketcherPrs_SensitivePoint::Matches (SelectBasics_SelectingVolu
 
 gp_Pnt SketcherPrs_SensitivePoint::Point() const
 {
+  gp_Pnt aPoint(0, 0, 0);
   const Handle(SelectMgr_EntityOwner)& anOwner =
     Handle(SelectMgr_EntityOwner)::DownCast(OwnerId());
-  const Handle(SketcherPrs_SymbolPrs)& aSymbPrs =
-    Handle(SketcherPrs_SymbolPrs)::DownCast(anOwner->Selectable());
-  return aSymbPrs->pointsArray()->Vertice(myId);
+  if (!anOwner.IsNull()) {
+    const Handle(SketcherPrs_SymbolPrs)& aSymbPrs =
+      Handle(SketcherPrs_SymbolPrs)::DownCast(anOwner->Selectable());
+    aPoint = aSymbPrs->pointsArray()->Vertice(myId);
+  }
+  return aPoint;
 }
 
 Handle(Select3D_SensitiveEntity) SketcherPrs_SensitivePoint::GetConnected()