diff --git a/include/podio/Frame.h b/include/podio/Frame.h index d7b712703..a4d0ad37b 100644 --- a/include/podio/Frame.h +++ b/include/podio/Frame.h @@ -391,11 +391,13 @@ const CollT& Frame::put(CollT&& coll, const std::string& name) { template Frame::FrameModel::FrameModel(std::unique_ptr data) : - m_mapMtx(std::make_unique()), - m_data(std::move(data)), - m_dataMtx(std::make_unique()), - m_idTable(std::move(m_data->getIDTable())), - m_parameters(std::move(m_data->getParameters())) { + m_mapMtx(std::make_unique()), m_dataMtx(std::make_unique()) { + 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