diff --git a/src/utils.cpp b/src/utils.cpp index 5ae76ed00d..8bd36a8065 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -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:") {