Skip to content

Commit

Permalink
Make sure to only access vector members if available
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Jul 25, 2023
1 parent 888b698 commit 2264489
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/templates/CollectionData.cc.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ void {{ class_type }}::clear(bool isSubsetColl) {

podio::CollectionWriteBuffers {{ class_type }}::getCollectionBuffers(bool isSubsetColl) {
{% if VectorMembers %}
// Make sure these point to the right place, even if a collection has been
// moved since it has been created
if (!isSubsetColl) {
// Make sure these point to the right place, even if a collection has been
// moved since it has been created
{% for member in VectorMembers %}
m_vecmem_info[{{ loop.index0 }}].second = &m_vec_{{ member.name }};
m_vecmem_info[{{ loop.index0 }}].second = &m_vec_{{ member.name }};
{% endfor %}
}
{% endif -%}

return {
Expand Down

0 comments on commit 2264489

Please sign in to comment.