From 6b26fa6ca7effe200edb2947fd9c200ae86f8571 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 17 Apr 2017 11:07:54 +0200 Subject: [PATCH] fix segmentation fault in TaskFeaturePick::makeCopy --- src/Mod/PartDesign/Gui/TaskFeaturePick.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Mod/PartDesign/Gui/TaskFeaturePick.cpp b/src/Mod/PartDesign/Gui/TaskFeaturePick.cpp index 02da50f264..7479ed452a 100644 --- a/src/Mod/PartDesign/Gui/TaskFeaturePick.cpp +++ b/src/Mod/PartDesign/Gui/TaskFeaturePick.cpp @@ -287,6 +287,9 @@ std::vector TaskFeaturePick::buildFeatures() App::DocumentObject* TaskFeaturePick::makeCopy(App::DocumentObject* obj, std::string sub, bool independent) { App::DocumentObject* copy = nullptr; + // Check for null to avoid segfault + if (!obj) + return copy; if( independent && (obj->isDerivedFrom(Sketcher::SketchObject::getClassTypeId()) || obj->isDerivedFrom(PartDesign::FeaturePrimitive::getClassTypeId()))) {