From 36fe5994b97a41c75e583241072ace1e8cfc9443 Mon Sep 17 00:00:00 2001 From: DeepSOIC Date: Wed, 24 Jun 2015 14:45:21 +0300 Subject: [PATCH] Revolution: fix crash when selecting stuff during task --- src/Mod/PartDesign/App/FeatureSketchBased.cpp | 2 +- src/Mod/PartDesign/Gui/ReferenceSelection.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index de240c674..5256fa278 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -1060,7 +1060,7 @@ void SketchBased::getAxis(const App::DocumentObject *pcReferenceAxis, const std: throw Base::Exception("Rotation axis must not be perpendicular with the sketch plane"); } else if (pcReferenceAxis->getTypeId().isDerivedFrom(PartDesign::Feature::getClassTypeId())) { - if (subReferenceAxis[0].empty()) + if (subReferenceAxis.empty()) throw Base::Exception("No rotation axis reference specified"); const Part::Feature* refFeature = static_cast(pcReferenceAxis); Part::TopoShape refShape = refFeature->Shape.getShape(); diff --git a/src/Mod/PartDesign/Gui/ReferenceSelection.cpp b/src/Mod/PartDesign/Gui/ReferenceSelection.cpp index 2092b3def..dc10fbf0f 100644 --- a/src/Mod/PartDesign/Gui/ReferenceSelection.cpp +++ b/src/Mod/PartDesign/Gui/ReferenceSelection.cpp @@ -156,9 +156,11 @@ const QString getRefStr(const App::DocumentObject* obj, const std::vectorgetNameInDocument()); - else + else if (sub.size()>0) return QString::fromAscii(obj->getNameInDocument()) + QString::fromAscii(":") + QString::fromAscii(sub.front().c_str()); + else + return QString(); } const std::string getPythonStr(const App::DocumentObject* obj, const std::vector& sub)