Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2007-11-23 08:54:13 +0000
committerMarkus Schorn2007-11-23 08:54:13 +0000
commit18e577037552d0613d36ec09ae4bb0480c5a38c7 (patch)
treef9115006f71b2032a98ad2903efff2c935402e06
parent8bcb9f2be8fc131936ee603650a4783e82ac03e0 (diff)
downloadorg.eclipse.cdt-18e577037552d0613d36ec09ae4bb0480c5a38c7.tar.gz
org.eclipse.cdt-18e577037552d0613d36ec09ae4bb0480c5a38c7.tar.xz
org.eclipse.cdt-18e577037552d0613d36ec09ae4bb0480c5a38c7.zip
Checks for null-pointers by Paul Warren (bug 209676).
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java14
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java14
2 files changed, 16 insertions, 12 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java
index 24de1faab44..93333648601 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java
@@ -2527,12 +2527,14 @@ public class PathEntryTranslator {
public boolean visit(PathSettingsContainer container) {
CResourceData data = (CResourceData)container.getValue();
- PathEntryCollector child = cr.createChild(container.getPath());
- for(int i = 0; i < kinds.length; i++){
- List list = new ArrayList();
- if(collectEntries(kinds[i], data, list)){
- ICLanguageSettingEntry[] entries = (ICLanguageSettingEntry[])list.toArray(new ICLanguageSettingEntry[list.size()]);
- child.setEntries(kinds[i], entries, exportedSettings);
+ if (data != null) {
+ PathEntryCollector child = cr.createChild(container.getPath());
+ for(int i = 0; i < kinds.length; i++){
+ List list = new ArrayList();
+ if(collectEntries(kinds[i], data, list)){
+ ICLanguageSettingEntry[] entries = (ICLanguageSettingEntry[])list.toArray(new ICLanguageSettingEntry[list.size()]);
+ child.setEntries(kinds[i], entries, exportedSettings);
+ }
}
}
return true;
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java
index c5f053fc7af..1456b8de679 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/index/IndexFactory.java
@@ -215,13 +215,15 @@ public class IndexFactory {
if(pd!=null) {
IndexProviderManager ipm = CCoreInternals.getPDOMManager().getIndexProviderManager();
ICConfigurationDescription cfg= pd.getDefaultSettingConfiguration();
- try {
- IIndexFragment[] pFragments= ipm.getProvidedIndexFragments(cfg);
- for(int i=0; i<pFragments.length; i++) {
- safeAddFragment(fragments, pFragments[i]);
+ if (cfg != null) {
+ try {
+ IIndexFragment[] pFragments= ipm.getProvidedIndexFragments(cfg);
+ for(int i=0; i<pFragments.length; i++) {
+ safeAddFragment(fragments, pFragments[i]);
+ }
+ } catch(CoreException ce) {
+ CCorePlugin.log(ce);
}
- } catch(CoreException ce) {
- CCorePlugin.log(ce);
}
}
}

Back to the top