diff --git a/src/App/Document.cpp b/src/App/Document.cpp index ed2a2e2006..41af73e1a5 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -3221,6 +3221,10 @@ bool Document::containsObject(const DocumentObject* pcObject) const void Document::removeObject(const char* sName) { auto pos = d->objectMap.find(sName); + if (pos == d->objectMap.end()){ + FC_MSG("Object " << sName << " already deleted in document " << getName()); + return; + } if (pos->second->testStatus(ObjectStatus::PendingRecompute)) { // TODO: shall we allow removal if there is active undo transaction?