From 31e4fd8994353cb35034d0120f61497263539378 Mon Sep 17 00:00:00 2001 From: DeepSOIC Date: Sat, 16 May 2015 17:26:44 +0300 Subject: [PATCH] Sketcher: fix free-standing sketches See forum thread, Sketch support == NULL http://forum.freecadweb.org/viewtopic.php?f=20&t=10942 --- src/Mod/Part/App/Part2DObject.cpp | 2 +- src/Mod/Sketcher/App/SketchObject.cpp | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Mod/Part/App/Part2DObject.cpp b/src/Mod/Part/App/Part2DObject.cpp index 9f224d8e3..4b82fbf6a 100644 --- a/src/Mod/Part/App/Part2DObject.cpp +++ b/src/Mod/Part/App/Part2DObject.cpp @@ -82,7 +82,7 @@ void Part2DObject::positionBySupport(void) gp_Pln plane; App::DocumentObject* support = Support.getValue(); if (support == NULL) - throw Base::Exception("Sketch support has been deleted"); + return; if (support->getTypeId().isDerivedFrom(App::Plane::getClassTypeId())) { // Find the name of the Baseplane without having to access PartDesignGui::BaseplaneNames[] diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 3a52ac93e..07a390269 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -129,10 +129,8 @@ App::DocumentObjectExecReturn *SketchObject::execute(void) { try { App::DocumentObject* support = Support.getValue(); - if (support == NULL) - return new App::DocumentObjectExecReturn("Sketch support has been deleted"); - - this->positionBySupport(); + if (support) + this->positionBySupport(); } catch (const Base::Exception& e) { return new App::DocumentObjectExecReturn(e.what());