Skip to content
Snippets Groups Projects
Commit 8269be2a authored by Christian Kamm's avatar Christian Kamm
Browse files

Quickfix: Don't crash on ifstmts with a null statement member.

parent d282ee9b
No related branches found
No related tags found
No related merge requests found
......@@ -463,7 +463,8 @@ public:
// ### This may not be such a good idea, consider nested ifs...
for (; index != -1; --index) {
IfStatementAST *ifStatement = path.at(index)->asIfStatement();
if (ifStatement && isCursorOn(ifStatement->statement)
if (ifStatement && ifStatement->statement
&& isCursorOn(ifStatement->statement)
&& ! ifStatement->statement->asCompoundStatement()) {
_statement = ifStatement->statement;
return index;
......@@ -668,7 +669,7 @@ public:
}
}
if (! pattern)
if (! pattern || ! pattern->statement)
return -1;
unsigned splitKind = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment