fix crash on cancel primitive
This commit is contained in:
parent
6347fe8c86
commit
e7284ecde8
|
@ -91,6 +91,9 @@ PartDesign::Body *getBody(bool messageIfNot)
|
|||
|
||||
PartDesign::Body *getBodyFor(App::DocumentObject* obj, bool messageIfNot)
|
||||
{
|
||||
if(!obj || !obj->isValid())
|
||||
return nullptr;
|
||||
|
||||
PartDesign::Body * activeBody = Gui::Application::Instance->activeView()->getActiveObject<PartDesign::Body*>(PDBODYKEY);
|
||||
if(activeBody && activeBody->hasFeature(obj))
|
||||
return activeBody;
|
||||
|
@ -112,6 +115,9 @@ PartDesign::Body *getBodyFor(App::DocumentObject* obj, bool messageIfNot)
|
|||
|
||||
App::Part* getPartFor(App::DocumentObject* obj, bool messageIfNot) {
|
||||
|
||||
if(!obj || !obj->isValid())
|
||||
return nullptr;
|
||||
|
||||
PartDesign::Body* body = getBodyFor(obj, false);
|
||||
if(body)
|
||||
obj = body;
|
||||
|
|
Loading…
Reference in New Issue
Block a user