Skip to content

Commit

Permalink
Re #4539. Put more protection around detector ids
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-roman committed Jan 18, 2012
1 parent fc55e64 commit 909324d
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Code/Mantid/Framework/Algorithms/src/DiffractionFocussing2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,17 +532,23 @@ int DiffractionFocussing2::validateSpectrumInGroup(size_t wi)
if (*it < 0) // bad pixel id
return -1;

const int group = udet2group[*it];
if (group <= 0)
return -1;
it++;
for (; it != dets.end(); ++it) // Loop other all other udets
{
if (udet2group[*it] != group)
try
{// what if index out of range?
const int group = udet2group.at(*it);
if (group <= 0)
return -1;
it++;
for (; it != dets.end(); ++it) // Loop other all other udets
{
if (udet2group.at(*it) != group)
return -1;
}
return group;
}
catch(...)
{}

return group;
return -1;
}


Expand Down

0 comments on commit 909324d

Please sign in to comment.