]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for crash in fillet
authordbv <dbv@opencascade.com>
Wed, 18 Nov 2015 06:49:22 +0000 (09:49 +0300)
committerdbv <dbv@opencascade.com>
Wed, 18 Nov 2015 06:49:35 +0000 (09:49 +0300)
src/Events/Events_Loop.cpp
src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp

index da0d8786221b08f93fbe92fd3a338160377cec68..d2d96de532ceda5a4c43bb051fadad2a3ebb7f21 100644 (file)
@@ -129,7 +129,10 @@ void Events_Loop::flush(const Events_ID& theID)
     send(aGroup, false);
 
     if (!aWasFlushed)
-      myFlushed.erase(myFlushed.find(theID.myID));
+      // TODO: Stabilization fix. Check later.
+      if(myFlushed.find(theID.myID) != myFlushed.end()) {
+        myFlushed.erase(myFlushed.find(theID.myID));
+      }
   }
 }
 
index d723a3e209d2a5e007cb89654398011829f3fd58..bf47039b18183bb8768927d2328a0a7d6a9c98ad 100644 (file)
@@ -226,6 +226,10 @@ void SketchPlugin_ConstraintFillet::execute()
   // Calculate fillet arc parameters
   std::shared_ptr<GeomAPI_XY> aCenter, aTangentPntA, aTangentPntB;
   calculateFilletCenter(anOldFeatureA, anOldFeatureB, aFilletRadius, isStart, aCenter, aTangentPntA, aTangentPntB);
+  if(!aCenter.get() || !aTangentPntA.get() || !aTangentPntB.get()) {
+    setError("Can not create fillet with the specified parameters.");
+    return;
+  }
   // update features
   std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
       aNewFeatureA->attribute(aFeatAttributes[isStart[0] ? 0 : 1]))->setValue(