Skip to content

Commit

Permalink
Fix minor compile issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
wcjohns committed May 10, 2024
1 parent 286d0e0 commit 75a56af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/DetectionLimitCalc.cpp
Expand Up @@ -141,7 +141,10 @@ void batch_test()
if( meas.num_measurements() != 1 )
throw runtime_error( "Not exactly one measurement in the file" );

const shared_ptr<const SpecUtils::Measurement> spectrum = meas.measurement( size_t(0) );
vector<shared_ptr<const SpecUtils::Measurement>> meass = meas.measurements();
assert( !meass.empty() );

const shared_ptr<const SpecUtils::Measurement> spectrum = meass.empty() ? nullptr : meass[0];
if( !spectrum || (spectrum->num_gamma_channels() < 128) )
throw runtime_error( "No spectrum" );

Expand Down

0 comments on commit 75a56af

Please sign in to comment.