diff --git a/python/templates/Collection.cc.jinja2 b/python/templates/Collection.cc.jinja2 index 99cbd01af..44b4c139d 100644 --- a/python/templates/Collection.cc.jinja2 +++ b/python/templates/Collection.cc.jinja2 @@ -198,14 +198,15 @@ podio::CollectionReadBuffers createBuffers(bool isSubset) { }; readBuffers.recast = [](podio::CollectionReadBuffers& buffers) { + // We only have any of these buffers if this is not a subset collection if (buffers.data) { buffers.data = podio::CollectionWriteBuffers::asVector<{{ class.full_type }}Data>(buffers.data); - } {% if VectorMembers %} {% for member in VectorMembers %} (*buffers.vectorMembers)[{{ loop.index0 }}].second = podio::CollectionWriteBuffers::asVector<{{ member.full_type }}>((*buffers.vectorMembers)[{{ loop.index0 }}].second); {% endfor %} {% endif %} + } }; return readBuffers;