diff --git a/src/objmem.cpp b/src/objmem.cpp index 4a07fd8eb91..388dd524bf1 100644 --- a/src/objmem.cpp +++ b/src/objmem.cpp @@ -589,7 +589,10 @@ static void freeAllEntitiesImpl(PerPlayerObjectLists& entit for (auto* ent : list) { auto it = entityContainer.find(*ent); - ASSERT(it != entityContainer.end(), "%s not found in the global container!", Traits::entityName()); + if (it == entityContainer.end()) { + ASSERT(false, "%s not found in the global container!", Traits::entityName()); + continue; + } entityContainer.erase(it); } list.clear();