From 3adf18600355c833fa93b9b920d8ac5a5b4a886c Mon Sep 17 00:00:00 2001 From: William Johnson Date: Thu, 16 Mar 2023 11:00:24 -0700 Subject: [PATCH] Fix unexpected exception when downloading reference peak CSV. a std::function was being converted to a boost::function, which when the std::function was nullptr, is was creating a boost::function that tested non-empty. --- src/ReferencePhotopeakDisplay.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ReferencePhotopeakDisplay.cpp b/src/ReferencePhotopeakDisplay.cpp index b52b2891..0ccef8e7 100644 --- a/src/ReferencePhotopeakDisplay.cpp +++ b/src/ReferencePhotopeakDisplay.cpp @@ -278,7 +278,7 @@ namespace }//switch( refinfo.m_source_type ) - boost::function att_fcn = refinfo.m_input.m_shielding_att; + std::function att_fcn = refinfo.m_input.m_shielding_att; try { @@ -318,7 +318,9 @@ namespace assert( refinfo.m_input.m_shielding_an.empty() ); assert( refinfo.m_input.m_shielding_ad.empty() ); assert( refinfo.m_input.m_shielding_name.empty() ); - assert( refinfo.m_input.m_shielding_thickness.empty() ); + + // We may have a shielding thickness, but no material + //assert( refinfo.m_input.m_shielding_thickness.empty() ); out << "Shielding,None" << eol_char; }//