Merge pull request #125 from anthonyprintup/fix-124

fix(generator): Prevent calling `std::string::back` on an empty string
main
Duncan Ogilvie 1 year ago committed by GitHub
commit 56da4144ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -493,7 +493,7 @@ struct Generator {
throw std::runtime_error("Detected additional \" at the end of cmake block");
}
auto cmake_lf = tolf(cmake);
while (cmake_lf.back() == '\n')
while (!cmake_lf.empty() && cmake_lf.back() == '\n')
cmake_lf.pop_back();
bool did_indent = false;
for (char ch : cmake_lf) {

Loading…
Cancel
Save