From 14b4a99e3361e4e102784e4e745f311da711094c Mon Sep 17 00:00:00 2001 From: jrheinlaender Date: Thu, 3 Oct 2013 20:43:01 +0200 Subject: [PATCH] Fix bug in PartDesignGui Workbench that may cause a crash --- src/Mod/PartDesign/Gui/Workbench.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Workbench.cpp b/src/Mod/PartDesign/Gui/Workbench.cpp index 8d4e0439f6..4487571967 100644 --- a/src/Mod/PartDesign/Gui/Workbench.cpp +++ b/src/Mod/PartDesign/Gui/Workbench.cpp @@ -277,9 +277,11 @@ void switchToDocument(const App::Document* doc) sketch->getNameInDocument(), Datum.c_str(), side.c_str()); Gui::Selection().clearSelection(); - Gui::Selection().addSelection(doc->getName(), oldTip->getNameInDocument()); - Gui::Command::doCommand(Gui::Command::Gui,"FreeCADGui.runCommand('PartDesign_MoveTip')"); - Gui::Selection().clearSelection(); + if (oldTip != NULL) { + Gui::Selection().addSelection(doc->getName(), oldTip->getNameInDocument()); + Gui::Command::doCommand(Gui::Command::Gui,"FreeCADGui.runCommand('PartDesign_MoveTip')"); + Gui::Selection().clearSelection(); + } } }