1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Bug 422217 - NPE in IndexLocationFactory.getAbsolutePath

This commit is contained in:
Sergey Prigogin 2013-11-21 11:47:18 -08:00
parent 24922585f0
commit 4f485bfd58

View file

@ -72,6 +72,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateInstance;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.index.IIndexFile;
import org.eclipse.cdt.core.index.IIndexFileLocation;
import org.eclipse.cdt.core.index.IIndexFileSet;
import org.eclipse.cdt.core.index.IIndexInclude;
import org.eclipse.cdt.core.index.IIndexName;
@ -796,7 +797,10 @@ public class IncludeOrganizer {
IIndexFile indexFile = request.getDeclaringFiles().keySet().iterator().next();
if (!includedByPartner.contains(indexFile)) {
for (IIndexInclude include : indexFile.getIncludes()) {
fContext.addHeaderAlreadyIncluded(getAbsolutePath(include.getIncludesLocation()));
IIndexFileLocation headerLocation = include.getIncludesLocation();
if (headerLocation != null) {
fContext.addHeaderAlreadyIncluded(getAbsolutePath(headerLocation));
}
}
includedByPartner.add(indexFile);
}