diff -r 5bd755eaa5a8 -r 1a04364d20b5 src/model.cpp --- 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; } /**