forked from qt-creator/qt-creator
Fix crash related to 'add definition from declaration' quickfix.
Reviewed-by: hjk Reviewed-by: Erik Verbruggen
This commit is contained in:
@@ -287,8 +287,10 @@ QList<CppQuickFixOperation::Ptr> DefFromDecl::match(const CppQuickFixState &stat
|
||||
CppRefactoringChanges refactoring(state.snapshot());
|
||||
InsertionPointLocator locator(&refactoring);
|
||||
QList<CppQuickFixOperation::Ptr> results;
|
||||
foreach (const InsertionLocation &loc, locator.methodDefinition(decl))
|
||||
results.append(CppQuickFixOperation::Ptr(new InsertDefOperation(state, idx, decl, loc)));
|
||||
foreach (const InsertionLocation &loc, locator.methodDefinition(decl)) {
|
||||
if (loc.isValid())
|
||||
results.append(CppQuickFixOperation::Ptr(new InsertDefOperation(state, idx, decl, loc)));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user