diff --git a/src/gui/plugins/entity_tree/EntityTree.cc b/src/gui/plugins/entity_tree/EntityTree.cc index 8a0ae74152..79de5dfb7f 100644 --- a/src/gui/plugins/entity_tree/EntityTree.cc +++ b/src/gui/plugins/entity_tree/EntityTree.cc @@ -132,6 +132,13 @@ void TreeModel::AddEntity(unsigned int _entity, const QString &_entityName, return; } + if (this->entityItems.find(_entity) != this->entityItems.end()) + { + ignwarn << "Internal error: Trying to create item for entity [" << _entity + << "], but entity already has an item." << std::endl; + return; + } + // New entity item auto entityItem = new QStandardItem(_entityName); entityItem->setData(_entityName, this->roleNames().key("entityName"));