Skip to content

Commit

Permalink
Check if the data passed to the frame model is not a nullptr
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Apr 9, 2024
1 parent b94cc63 commit 825f825
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions include/podio/Frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,13 @@ const CollT& Frame::put(CollT&& coll, const std::string& name) {

template <typename FrameDataT>
Frame::FrameModel<FrameDataT>::FrameModel(std::unique_ptr<FrameDataT> data) :
m_mapMtx(std::make_unique<std::mutex>()),
m_data(std::move(data)),
m_dataMtx(std::make_unique<std::mutex>()),
m_idTable(std::move(m_data->getIDTable())),
m_parameters(std::move(m_data->getParameters())) {
m_mapMtx(std::make_unique<std::mutex>()), m_dataMtx(std::make_unique<std::mutex>()) {
if (!data) {
throw std::invalid_argument("Building a Frame failed; if you are reading from a file it may be corrupted");
}
m_data = std::move(data);
m_idTable = std::move(m_data->getIDTable());
m_parameters = std::move(m_data->getParameters());
}

template <typename FrameDataT>
Expand Down

0 comments on commit 825f825

Please # to comment.