Skip to content
Snippets Groups Projects
Commit 7edb110e authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Check for valid paths


Reviewed-By: default avatarChristian Kamm <christian.d.kamm@nokia.com>
parent 6de52c40
No related branches found
No related tags found
No related merge requests found
...@@ -275,9 +275,6 @@ public: ...@@ -275,9 +275,6 @@ public:
virtual int match(const QList<AST *> &path) virtual int match(const QList<AST *> &path)
{ {
if (path.size() == 0)
return -1;
// show when we're on the 'if' of an if statement // show when we're on the 'if' of an if statement
int index = path.size() - 1; int index = path.size() - 1;
IfStatementAST *ifStatement = path.at(index)->asIfStatement(); IfStatementAST *ifStatement = path.at(index)->asIfStatement();
...@@ -805,7 +802,8 @@ int CPPQuickFixCollector::startCompletion(TextEditor::ITextEditable *editable) ...@@ -805,7 +802,8 @@ int CPPQuickFixCollector::startCompletion(TextEditor::ITextEditable *editable)
ASTPath astPath(info.doc); ASTPath astPath(info.doc);
const QList<AST *> path = astPath(_editor->textCursor()); const QList<AST *> path = astPath(_editor->textCursor());
// ### build the list of the quick fix ops by scanning path. if (path.isEmpty())
return -1;
QSharedPointer<RewriteLogicalAndOp> rewriteLogicalAndOp(new RewriteLogicalAndOp(info.doc, info.snapshot, _editor)); QSharedPointer<RewriteLogicalAndOp> rewriteLogicalAndOp(new RewriteLogicalAndOp(info.doc, info.snapshot, _editor));
QSharedPointer<SplitIfStatementOp> splitIfStatementOp(new SplitIfStatementOp(info.doc, info.snapshot, _editor)); QSharedPointer<SplitIfStatementOp> splitIfStatementOp(new SplitIfStatementOp(info.doc, info.snapshot, _editor));
......
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