diff --git a/Applications/FileIO/CsvInterface.cpp b/Applications/FileIO/CsvInterface.cpp index 22076fa613e30ede0dd02c74ab26db7487790718..5536da166ab3cdde78092fe05a639c4cdc439797 100644 --- a/Applications/FileIO/CsvInterface.cpp +++ b/Applications/FileIO/CsvInterface.cpp @@ -30,21 +30,24 @@ std::vector<std::string> CsvInterface::getColumnNames(std::string const& fname, if (!in.is_open()) { - ERR("CsvInterface::readPoints(): Could not open file {:s}.", fname); + ERR("CsvInterface::getColumnNames(): Could not open file {:s}.", fname); return std::vector<std::string>(); } std::string line; if (!std::getline(in, line)) { + ERR("CsvInterface::getColumnNames(): Could not read line from file " + "{:s}. Is it empty?", + fname); return {}; } - std::list<std::string> fields; - if (delim != '\n') + if (delim == '\n') { - fields = BaseLib::splitString(line, delim); + return {}; } + std::list<std::string> fields = BaseLib::splitString(line, delim); if (fields.size() < 2) { for (char const d : {'\t', ';', ','})