PropertyExpressionEngine::slotObjectRenamed(...): return immediately if the property's owner is not part of an object (e.g on the undo stack).

This commit is contained in:
Eivind Kvedalen 2015-12-19 16:37:47 +01:00 committed by wmayer
parent 9c7b9ed2c0
commit 7b25d454b5

View File

@ -295,6 +295,12 @@ void PropertyExpressionEngine::slotObjectRenamed(const DocumentObject &obj)
std::clog << "Object " << obj.getOldLabel() << " renamed to " << obj.Label.getValue() << std::endl;
#endif
DocumentObject * docObj = freecad_dynamic_cast<DocumentObject>(getContainer());
/* In a document object, and on undo stack? */
if (!docObj || docObj->getNameInDocument() == 0)
return;
RelabelDocumentObjectExpressionVisitor v(boost::bind( &PropertyExpressionEngine::aboutToSetValue, this),
boost::bind( &PropertyExpressionEngine::hasSetValue, this),
obj.getOldLabel(), obj.Label.getStrValue());