From 5bf045a27ece00b52f827ab8b942f817ec1077f1 Mon Sep 17 00:00:00 2001 From: dbv Date: Wed, 18 Nov 2015 09:49:22 +0300 Subject: [PATCH] Fix for crash in fillet --- src/Events/Events_Loop.cpp | 5 ++++- src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Events/Events_Loop.cpp b/src/Events/Events_Loop.cpp index da0d87862..d2d96de53 100644 --- a/src/Events/Events_Loop.cpp +++ b/src/Events/Events_Loop.cpp @@ -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)); + } } } diff --git a/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp b/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp index d723a3e20..bf47039b1 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintFillet.cpp @@ -226,6 +226,10 @@ void SketchPlugin_ConstraintFillet::execute() // Calculate fillet arc parameters std::shared_ptr 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( aNewFeatureA->attribute(aFeatAttributes[isStart[0] ? 0 : 1]))->setValue( -- 2.39.2