Skip to content

Commit

Permalink
Fix reading an indexed frame
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Jan 18, 2024
1 parent 0869689 commit 8e36225
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ podio::Frame Reader::readNextFrame(const std::string& name) {
}

podio::Frame Reader::readFrame(const std::string& name, size_t index) {
return m_reader->readEntry(name, index);
auto frame = m_reader->readEntry(name, index);
if (frame) {
return std::move(frame.value());
} else {
std::cout << "No frames available for category " << name << " at index " << index << std::endl;
return podio::Frame();
}
}

size_t Reader::getEntries(const std::string& name) {
Expand Down

0 comments on commit 8e36225

Please sign in to comment.