throw EOF exception in TextFileReader::next_values() if next_line() doesn't do it

This commit is contained in:
Axel Kohlmeyer
2021-04-18 04:04:40 -04:00
parent ac60cfb0c3
commit 8af1530e29

View File

@ -175,5 +175,8 @@ void TextFileReader::next_dvector(double * list, int n) {
* \return ValueTokenizer object for read in text */ * \return ValueTokenizer object for read in text */
ValueTokenizer TextFileReader::next_values(int nparams, const std::string &separators) { ValueTokenizer TextFileReader::next_values(int nparams, const std::string &separators) {
return ValueTokenizer(next_line(nparams), separators); char *ptr = next_line(nparams);
if (ptr == nullptr)
throw EOFException(fmt::format("Missing line in {} file!", filetype));
return ValueTokenizer(line, separators);
} }