Salome HOME
Issue #19187: B-Splines - Crash with specific scenario
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Validators.cpp
index fbc98f205b3266038eabf96d205ce2e108f7ea67..9feba7df8772bba8cba3aa638643262b508a9bee 100644 (file)
@@ -239,7 +239,13 @@ bool SketchPlugin_TangentAttrValidator::isValid(const AttributePtr& theAttribute
         SketchPlugin_Tools::findCoincidences(*anIt, SketchPlugin_Constraint::ENTITY_A(),
                                              aCoinc, true);
 
-      isValid = aCoinc.find(aOtherFea) != aCoinc.end();
+      std::set<FeaturePtr>::iterator aFoundCoinc = aCoinc.find(aOtherFea);
+      if (aFoundCoinc != aCoinc.end()) {
+        // do not take into account internal constraints
+        AttributeReferencePtr aParent =
+            (*aFoundCoinc)->reference(SketchPlugin_SketchEntity::PARENT_ID());
+        isValid = !aParent || !aParent->isInitialized() || aParent->value() != aRefFea;
+      }
     }
   }