From 9d1c1ba0e1b4d12f44acfaf7d7c92bd33b78497d Mon Sep 17 00:00:00 2001 From: Eivind Kvedalen Date: Sat, 19 Dec 2015 16:37:47 +0100 Subject: [PATCH] PropertyExpressionEngine::slotObjectRenamed(...): return immediately if the property's owner is not part of an object (e.g on the undo stack). --- src/App/PropertyExpressionEngine.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/App/PropertyExpressionEngine.cpp b/src/App/PropertyExpressionEngine.cpp index 54a3dc377b..fdbcb7bdab 100644 --- a/src/App/PropertyExpressionEngine.cpp +++ b/src/App/PropertyExpressionEngine.cpp @@ -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(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());