mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Protect against NPE.
This commit is contained in:
parent
3c61ffa5ef
commit
2015ebc3d0
1 changed files with 8 additions and 9 deletions
|
@ -220,17 +220,16 @@ public class HeaderFileReferenceAdjuster {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextEditGroup createEdit(ITranslationUnit tu, IProgressMonitor pm)
|
private TextEditGroup createEdit(ITranslationUnit tu, IProgressMonitor monitor)
|
||||||
throws CoreException, OperationCanceledException {
|
throws CoreException, OperationCanceledException {
|
||||||
checkCanceled(pm);
|
checkCanceled(monitor);
|
||||||
|
|
||||||
SubMonitor progress = SubMonitor.convert(pm, 2);
|
SubMonitor progress = SubMonitor.convert(monitor, 3);
|
||||||
try {
|
|
||||||
IASTTranslationUnit ast = astManager.getAST(index, tu.getFile(), PARSE_MODE, false);
|
IASTTranslationUnit ast = astManager.getAST(index, tu.getFile(), PARSE_MODE, false);
|
||||||
|
progress.setWorkRemaining(1);
|
||||||
|
if (ast == null)
|
||||||
|
return null;
|
||||||
return createEdit(ast, tu, progress.newChild(1));
|
return createEdit(ast, tu, progress.newChild(1));
|
||||||
} finally {
|
|
||||||
pm.done();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private TextEditGroup createEdit(IASTTranslationUnit ast, ITranslationUnit tu, IProgressMonitor pm)
|
private TextEditGroup createEdit(IASTTranslationUnit ast, ITranslationUnit tu, IProgressMonitor pm)
|
||||||
|
|
Loading…
Add table
Reference in a new issue