Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Ridge2018-11-16 02:52:23 +0000
committerNathan Ridge2018-11-24 18:54:21 +0000
commit636fe00de609a6c2764360388fd070d862f916f2 (patch)
treeb1344f51a6867498ae2451943904689bb514a801
parent5b21097125aadd908b731c750b02913250263142 (diff)
downloadorg.eclipse.cdt-636fe00de609a6c2764360388fd070d862f916f2.tar.gz
org.eclipse.cdt-636fe00de609a6c2764360388fd070d862f916f2.tar.xz
org.eclipse.cdt-636fe00de609a6c2764360388fd070d862f916f2.zip
Bug 541118 - NPE in AbstractIndexerTask.getOffset
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java
index 8569a7f7887..afa227f6f5f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/AbstractIndexerTask.java
@@ -296,7 +296,10 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
private static int getOffset(IIndexMacro[] macros, int m) throws CoreException {
if (m < macros.length) {
- return macros[m].getFileLocation().getNodeOffset();
+ IASTFileLocation fileLoc = macros[m].getFileLocation();
+ if (fileLoc != null) {
+ return fileLoc.getNodeOffset();
+ }
}
return Integer.MAX_VALUE;
}

Back to the top