From ee34d09f7a74ad340b2cd227f54205af93d7a1f3 Mon Sep 17 00:00:00 2001 From: Florian Foinant-Willig Date: Thu, 6 Nov 2025 15:22:06 +0100 Subject: [PATCH] Core: add a check on object deletion --- src/App/Document.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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?