mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix NPE
This commit is contained in:
parent
9e9d53454b
commit
53f01e7086
1 changed files with 4 additions and 1 deletions
|
@ -228,6 +228,9 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
|||
}
|
||||
long startTime= System.currentTimeMillis();
|
||||
final IASTTranslationUnit ast= fTranslationUnit.getAST(index, quickParseMode ? ITranslationUnit.AST_SKIP_ALL_HEADERS : 0);
|
||||
if (ast == null) {
|
||||
return;
|
||||
}
|
||||
Util.debugLog("CModelBuilder2: parsing " //$NON-NLS-1$
|
||||
+ fTranslationUnit.getElementName()
|
||||
+ " mode="+ (quickParseMode ? "fast " : "full ") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
@ -372,7 +375,7 @@ public class CModelBuilder2 implements IContributedModelBuilder {
|
|||
final IASTFileLocation problemLocation= problem.getFileLocation();
|
||||
if (problemLocation != null) {
|
||||
final int startOffset= problemLocation.getNodeOffset();
|
||||
element.setIdPos(startOffset + nameIdx - 1, name.length() + 2);
|
||||
element.setIdPos(startOffset + nameIdx, name.length());
|
||||
}
|
||||
} else {
|
||||
setIdentifierPosition(element, problem);
|
||||
|
|
Loading…
Add table
Reference in a new issue