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) {
|
||||
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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue