Fix crash when building Speck cache (closes #2689)

This commit is contained in:
Alexander Bock
2023-05-16 22:52:54 +02:00
parent 108f027f95
commit d0d82b79fa

View File

@@ -154,7 +154,7 @@ Dataset loadFile(std::filesystem::path path, SkipAllZeroLines skipAllZeroLines)
// Guard against wrong line endings (copying files from Windows to Mac) causes
// lines to have a final \r
if (line.back() == '\r') {
if (!line.empty() && line.back() == '\r') {
line = line.substr(0, line.length() - 1);
}