--- a/src/model.cpp Sat Mar 05 12:42:14 2022 +0200 +++ b/src/model.cpp Sat Mar 05 12:47:10 2022 +0200 @@ -158,8 +158,9 @@ Q_EMIT this->beginInsertRows({}, position, position); this->body.push_back(std::move(object)); Q_EMIT this->endInsertRows(); - this->objectsById[object->id] = object.get(); - return object->id; + const ldraw::id_t id = this->body.back()->id; + this->objectsById[id] = this->body.back().get(); + return id; } /**