Skip to content
Snippets Groups Projects
Commit 99e73977 authored by Federico Montesino Pouzols's avatar Federico Montesino Pouzols
Browse files

error check, alleviate issue 1304130, probably won't fix it, re #13951

parent 743753b4
No related merge requests found
......@@ -804,6 +804,10 @@ void GroupDetectors2::readFile(spec2index_map &specs2index, std::istream &File,
numberOfSpectra = readInt(thisLine);
} while (numberOfSpectra == EMPTY_LINE);
if (numberOfSpectra <= 0) {
throw std::invalid_argument("The number of spectra is zero or negative");
}
// the value of this map is the list of spectra numbers that will be
// combined into a group
m_GroupSpecInds[spectrumNo].reserve(numberOfSpectra);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment