1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 541118 - NPE in AbstractIndexerTask.getOffset

Change-Id: I7ce30369abfb31dbdcc87e4fe9d36ea35e48ad79
This commit is contained in:
Nathan Ridge 2018-11-15 21:52:23 -05:00
parent 5b21097125
commit 636fe00de6

View file

@ -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;
}