fix for when the line is empty

This commit is contained in:
Laurent Rineau 2024-01-19 15:17:04 +01:00
parent c539c5657c
commit 885647fe4c
1 changed files with 1 additions and 1 deletions

View File

@ -601,7 +601,7 @@ bool build_triangulation_from_file(std::istream& is,
{ {
// remove trailing whitespace, in particular a possible '\r' from Windows // remove trailing whitespace, in particular a possible '\r' from Windows
// end-of-line encoding // end-of-line encoding
if(std::isspace(line.back())) { if(!line.empty() && std::isspace(line.back())) {
line.pop_back(); line.pop_back();
} }
if (line.size() > 0 && line.at(0) == '#' && if (line.size() > 0 && line.at(0) == '#' &&