Salome HOME
Issue #2998: Add help description for automatic creation of constraints
[modules/shaper.git] / src / XGUI / XGUI_SelectionActivate.cpp
index 62433d9f380451aef343020b9b7ee09017f3fa8b..10b1d84e5711f80688e74293a18063176e00669a 100644 (file)
@@ -549,14 +549,16 @@ void XGUI_SelectionActivate::deactivateTrihedron(const bool theUpdateViewer) con
 void XGUI_SelectionActivate::deactivateTrihedronInSelectionModes()
 {
   Handle(AIS_InteractiveContext) aContext = AISContext();
-  Handle(AIS_Trihedron) aTrihedron = Handle(AIS_Trihedron)::DownCast(getTrihedron());
-  /// deactivate trihedron in selection modes
-  TColStd_ListOfInteger aTColModes;
-  aContext->ActivatedModes(aTrihedron, aTColModes);
-  TColStd_ListIteratorOfListOfInteger itr( aTColModes );
-  for (; itr.More(); itr.Next() ) {
-    Standard_Integer aMode = itr.Value();
-    aContext->Deactivate(aTrihedron, aMode);
+  if (!aContext.IsNull()) {
+    Handle(AIS_Trihedron) aTrihedron = Handle(AIS_Trihedron)::DownCast(getTrihedron());
+    /// deactivate trihedron in selection modes
+    TColStd_ListOfInteger aTColModes;
+    aContext->ActivatedModes(aTrihedron, aTColModes);
+    TColStd_ListIteratorOfListOfInteger itr(aTColModes);
+    for (; itr.More(); itr.Next()) {
+      Standard_Integer aMode = itr.Value();
+      aContext->Deactivate(aTrihedron, aMode);
+    }
   }
 }