mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Checks for null-pointers by Paul Warren, bug 209676.
This commit is contained in:
parent
9b07ea66db
commit
bac56fad6d
2 changed files with 16 additions and 12 deletions
|
@ -2527,12 +2527,14 @@ public class PathEntryTranslator {
|
||||||
|
|
||||||
public boolean visit(PathSettingsContainer container) {
|
public boolean visit(PathSettingsContainer container) {
|
||||||
CResourceData data = (CResourceData)container.getValue();
|
CResourceData data = (CResourceData)container.getValue();
|
||||||
PathEntryCollector child = cr.createChild(container.getPath());
|
if (data != null) {
|
||||||
for(int i = 0; i < kinds.length; i++){
|
PathEntryCollector child = cr.createChild(container.getPath());
|
||||||
List list = new ArrayList();
|
for(int i = 0; i < kinds.length; i++){
|
||||||
if(collectEntries(kinds[i], data, list)){
|
List list = new ArrayList();
|
||||||
ICLanguageSettingEntry[] entries = (ICLanguageSettingEntry[])list.toArray(new ICLanguageSettingEntry[list.size()]);
|
if(collectEntries(kinds[i], data, list)){
|
||||||
child.setEntries(kinds[i], entries, exportedSettings);
|
ICLanguageSettingEntry[] entries = (ICLanguageSettingEntry[])list.toArray(new ICLanguageSettingEntry[list.size()]);
|
||||||
|
child.setEntries(kinds[i], entries, exportedSettings);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -215,13 +215,15 @@ public class IndexFactory {
|
||||||
if(pd!=null) {
|
if(pd!=null) {
|
||||||
IndexProviderManager ipm = CCoreInternals.getPDOMManager().getIndexProviderManager();
|
IndexProviderManager ipm = CCoreInternals.getPDOMManager().getIndexProviderManager();
|
||||||
ICConfigurationDescription cfg= pd.getDefaultSettingConfiguration();
|
ICConfigurationDescription cfg= pd.getDefaultSettingConfiguration();
|
||||||
try {
|
if (cfg != null) {
|
||||||
IIndexFragment[] pFragments= ipm.getProvidedIndexFragments(cfg);
|
try {
|
||||||
for(int i=0; i<pFragments.length; i++) {
|
IIndexFragment[] pFragments= ipm.getProvidedIndexFragments(cfg);
|
||||||
safeAddFragment(fragments, pFragments[i]);
|
for(int i=0; i<pFragments.length; i++) {
|
||||||
|
safeAddFragment(fragments, pFragments[i]);
|
||||||
|
}
|
||||||
|
} catch(CoreException ce) {
|
||||||
|
CCorePlugin.log(ce);
|
||||||
}
|
}
|
||||||
} catch(CoreException ce) {
|
|
||||||
CCorePlugin.log(ce);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue