avoid crash in the case of checking an empty potential file
This commit is contained in:
@ -862,6 +862,7 @@ std::string utils::get_potential_date(const std::string &path, const std::string
|
||||
reader.ignore_comments = false;
|
||||
|
||||
char *line = reader.next_line();
|
||||
if (line == nullptr) return "";
|
||||
Tokenizer words(line);
|
||||
while (words.has_next()) {
|
||||
if (words.next() == "DATE:") {
|
||||
@ -881,6 +882,7 @@ std::string utils::get_potential_units(const std::string &path, const std::strin
|
||||
reader.ignore_comments = false;
|
||||
|
||||
char *line = reader.next_line();
|
||||
if (line == nullptr) return "";
|
||||
Tokenizer words(line);
|
||||
while (words.has_next()) {
|
||||
if (words.next() == "UNITS:") {
|
||||
|
||||
Reference in New Issue
Block a user