Editor: Fix crash in generic Highlighter for invalid rules

Change-Id: I3da9115ecd54f72256e4ee399b2cd37e31f6bcbe
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
David Schulz
2017-03-08 10:18:34 +01:00
parent 4f91cb3d0c
commit 10c73bac51

View File

@@ -265,6 +265,9 @@ bool KeywordRule::doMatchSucceed(const QString &text,
const int length, const int length,
ProgressData *progress) ProgressData *progress)
{ {
if (m_list.isNull()) // Happens if a keyword rule points to a none existing keyword list
return false;
int current = progress->offset(); int current = progress->offset();
if (current > 0 && !definition()->isDelimiter(text.at(current - 1))) if (current > 0 && !definition()->isDelimiter(text.at(current - 1)))