From c2d97241eef3cec2af3539651c166d21eece54bc Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 29 Sep 2018 12:34:55 +0200 Subject: [PATCH] fix crash when creating a copy of datum object --- src/Mod/PartDesign/Gui/TaskFeaturePick.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Mod/PartDesign/Gui/TaskFeaturePick.cpp b/src/Mod/PartDesign/Gui/TaskFeaturePick.cpp index 779a6c11c8..fd7cf45d19 100644 --- a/src/Mod/PartDesign/Gui/TaskFeaturePick.cpp +++ b/src/Mod/PartDesign/Gui/TaskFeaturePick.cpp @@ -363,7 +363,9 @@ App::DocumentObject* TaskFeaturePick::makeCopy(App::DocumentObject* obj, std::st // TODO Replace it with commands (2015-09-11, Fat-Zer) if(obj->isDerivedFrom(Part::Datum::getClassTypeId())) { copy = App::GetApplication().getActiveDocument()->addObject( - obj->getClassTypeId().getName(), name.c_str() ); + obj->getTypeId().getName(), name.c_str() ); + + assert(copy->isDerivedFrom(Part::Datum::getClassTypeId())); //we need to reference the individual datums and make again datums. This is important as //datum adjust their size dependent on the part size, hence simply copying the shape is