Skip to content

Commit 56da414

Browse files
authored
Merge pull request #125 from anthonyprintup/fix-124
fix(generator): Prevent calling `std::string::back` on an empty string
2 parents 9388b3f + 079644c commit 56da414

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmake_generator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ struct Generator {
493493
throw std::runtime_error("Detected additional \" at the end of cmake block");
494494
}
495495
auto cmake_lf = tolf(cmake);
496-
while (cmake_lf.back() == '\n')
496+
while (!cmake_lf.empty() && cmake_lf.back() == '\n')
497497
cmake_lf.pop_back();
498498
bool did_indent = false;
499499
for (char ch : cmake_lf) {

0 commit comments

Comments
 (0)