Quickfix: Don't crash when the AST path is empty.

This commit is contained in:
Christian Kamm
2009-11-25 09:59:59 +01:00
parent e237036e03
commit d2e7f8e4e6

View File

@@ -275,6 +275,9 @@ public:
virtual int match(const QList<AST *> &path)
{
if (path.size() == 0)
return -1;
// show when we're on the 'if' of an if statement
int index = path.size() - 1;
IfStatementAST *ifStatement = path.at(index)->asIfStatement();