src: crash fixes

* fixed crash when snippet has no code.
* fixed crash when saving a filenode with special characters in its name
* fixed crash when aborting the parsing
This commit is contained in:
malte_langkabel
2016-05-20 13:52:37 +02:00
parent 946be38fa2
commit 4a6f8cf420
4 changed files with 36 additions and 5 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ QtCodeArea::QtCodeArea(
m_highlighter = new QtHighlighter(document());
std::string displayCode = m_code;
if (*displayCode.rbegin() == '\n')
if (!displayCode.empty() && *displayCode.rbegin() == '\n')
{
displayCode.pop_back();
}