App: fix crash on removing dynamic property

Related FreeCAD/FreeCAD#6840
This commit is contained in:
Zheng, Lei
2022-05-07 08:45:43 +08:00
committed by wwmayer
parent 1d0e2f243a
commit 24b6f06015

View File

@@ -693,7 +693,7 @@ void DocumentObject::setDocument(App::Document* doc)
bool DocumentObject::removeDynamicProperty(const char* name)
{
if (!_pDoc)
if (!_pDoc || testStatus(ObjectStatus::Destroy))
return false;
Property* prop = getDynamicPropertyByName(name);