Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-01-25 11:20:39 -0500
committerAndrew Gvozdev2012-01-25 11:21:11 -0500
commita6ca3ea2353f3b2ef221296a45ee4f43481991ca (patch)
tree4ebd2b74003c306c46b9503dc112f29435624178
parente8a9e67b8cd5023a26ce824c6d27b4e4d28c2910 (diff)
downloadorg.eclipse.cdt-a6ca3ea2353f3b2ef221296a45ee4f43481991ca.tar.gz
org.eclipse.cdt-a6ca3ea2353f3b2ef221296a45ee4f43481991ca.tar.xz
org.eclipse.cdt-a6ca3ea2353f3b2ef221296a45ee4f43481991ca.zip
bug 369693: Using a workspace root as include paths causes NPE in
Project Explorer
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewLabelProvider.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewLabelProvider.java
index 5608d8a5ef..156a062bdf 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewLabelProvider.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CViewLabelProvider.java
@@ -111,11 +111,12 @@ public class CViewLabelProvider extends AppearanceAwareLabelProvider {
String imageKey = null;
if (element instanceof IncludeReferenceProxy) {
IIncludeReference reference = ((IncludeReferenceProxy)element).getReference();
- IContainer container = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(reference.getPath());
- if (container != null) {
+ IContainer containerInclude = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(reference.getPath());
+ if (containerInclude != null) {
ICProject cproject = reference.getCProject();
IProject project = (cproject != null) ? cproject.getProject() : null;
- boolean isProjectRelative = container.getProject().equals(project);
+ IProject projectInclude = containerInclude.getProject();
+ boolean isProjectRelative = projectInclude != null && projectInclude.equals(project);
imageKey = LanguageSettingsImages.getImageKey(ICSettingEntry.INCLUDE_PATH, ICSettingEntry.VALUE_WORKSPACE_PATH, isProjectRelative);
} else {
imageKey = CDTSharedImages.IMG_OBJS_INCLUDES_FOLDER;

Back to the top