Skip to content

Commit

Permalink
Additional check for AsymmetryCalc.
Browse files Browse the repository at this point in the history
Normally, this shouldn't happen, but it will help to identify problem
when it does.

Refs #7557
  • Loading branch information
arturbekasov committed Oct 17, 2013
1 parent 379c3c2 commit 855a27c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Code/Mantid/Framework/Algorithms/src/AsymmetryCalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ void AsymmetryCalc::exec()
specIDs[1] = backward;
std::vector<size_t> indices;
tmpWS->getIndicesFromSpectra( specIDs, indices );

// If some spectra were not found, can't continue
if(specIDs.size() != indices.size())
throw std::invalid_argument("Some of the spectra specified do not exist in a workspace");

forward = static_cast<int>( indices[0] );
backward = static_cast<int>( indices[1] );
}
Expand Down

0 comments on commit 855a27c

Please sign in to comment.