diff --git a/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc index f430c40e95d..8cf7af6fcb3 100644 --- a/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc +++ b/src/plugins/cmakeprojectmanager/3rdparty/rstparser/rstparser.cc @@ -212,7 +212,7 @@ void rst::Parser::ParseBlock( } // Remove a trailing newline. - if (*text.rbegin() == '\n') + if (!text.empty() && *text.rbegin() == '\n') text.resize(text.size() - 1); bool literal = type == PARAGRAPH && EndsWith(text, "::");