Skip to content

Commit

Permalink
EventHeader: check size before conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Zehvogel committed Apr 18, 2023
1 parent 9a73716 commit d113588
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions k4MarlinWrapper/src/components/EDM4hep2Lcio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ void EDM4hep2LcioTool::convertEventHeader(const std::string& e4h_coll_name, lcio
DataHandle<edm4hep::EventHeaderCollection> header_handle{e4h_coll_name, Gaudi::DataHandle::Reader, this};
const auto header_coll = header_handle.get();

if (header_coll->size() != 1) {
error() << "Header collection contains " << header_coll->size() << " headers, expected 1." << endmsg;
return;
}
convEventHeader(header_coll, lcio_event);
}

Expand Down

0 comments on commit d113588

Please sign in to comment.