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:
parent
2726670258
commit
d45ff124e3
2 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue