Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeOrganizer.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeOrganizer.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeOrganizer.java
index ad3d44f23fc..efd6ed51bda 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeOrganizer.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/includes/IncludeOrganizer.java
@@ -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;
@@ -797,7 +798,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);
}

Back to the top