1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 14:12:10 +02:00

Bug 510722 - Handle a null AST in ExpandSelectionJob and ControlFlowGraphView

Change-Id: Iafd1b9a32833fb67554902d13955023c149a132e
This commit is contained in:
Nathan Ridge 2017-01-20 01:45:39 -05:00 committed by Gerrit Code Review @ Eclipse.org
parent 2726670258
commit d45ff124e3
2 changed files with 7 additions and 1 deletions

View file

@ -300,6 +300,9 @@ public class ControlFlowGraphView extends ViewPart {
Job job = new SharedASTJob("Building Control Flow Grath", tu) { Job job = new SharedASTJob("Building Control Flow Grath", tu) {
@Override @Override
public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) throws CoreException { public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) throws CoreException {
if (ast == null) {
return Status.CANCEL_STATUS;
}
processAst(ast); processAst(ast);
return Status.OK_STATUS; return Status.OK_STATUS;
} }

View file

@ -56,7 +56,10 @@ public abstract class StructureSelectionAction extends TextEditorAction {
@Override @Override
public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) throws CoreException { public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) throws CoreException {
newSourceRange = doExpand(ast,currentSourceRange); if (ast == null) {
return Status.CANCEL_STATUS;
}
newSourceRange = doExpand(ast, currentSourceRange);
return Status.OK_STATUS; return Status.OK_STATUS;
} }
} }