forked from qt-creator/qt-creator
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:
@@ -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)))
|
||||||
|
|||||||
Reference in New Issue
Block a user