Skip to content

Commit

Permalink
Fix unexpected exception when downloading reference peak CSV.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wcjohns committed Mar 16, 2023
1 parent 3e988b3 commit 3adf186
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ReferencePhotopeakDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ namespace
}//switch( refinfo.m_source_type )


boost::function<double(float)> att_fcn = refinfo.m_input.m_shielding_att;
std::function<double( float )> att_fcn = refinfo.m_input.m_shielding_att;

try
{
Expand Down Expand Up @@ -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;
}//
Expand Down

0 comments on commit 3adf186

Please sign in to comment.