1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-09 10:05:24 +02:00

Bug 160115 - added a check for null config when resolving a proxy.

This commit is contained in:
David Dykstal 2006-10-09 21:29:30 +00:00
parent 11d262f563
commit 41f5e596c8

View file

@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Michael Scharf (WindRiver) - patch for an NPE in getSubSystemConfigurations()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.model; package org.eclipse.rse.model;
@ -1474,24 +1474,27 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven
/** /**
* Return all subsystem factories. Be careful when you call this, as it activates all * @return all subsystem configurations. Be careful when you call this, as it activates all
* subsystem factories. * subsystem factories.
*/ */
public ISubSystemConfiguration[] getSubSystemConfigurations() // fixed Bugzilla Bug 160115 - added non-null guard for config
{ public ISubSystemConfiguration[] getSubSystemConfigurations() {
Vector v = new Vector(); Vector v = new Vector();
ISubSystemConfigurationProxy[] proxies = getSubSystemConfigurationProxies(); ISubSystemConfigurationProxy[] proxies = getSubSystemConfigurationProxies();
if (proxies != null) {
if (proxies != null) for (int idx = 0; idx < proxies.length; idx++) {
{ ISubSystemConfigurationProxy proxy = proxies[idx];
ISubSystemConfiguration config = proxy.getSubSystemConfiguration();
for (int idx = 0; idx < proxies.length; idx++) if (config != null) {
{ v.add(proxies[idx].getSubSystemConfiguration());
v.add(proxies[idx].getSubSystemConfiguration()); }
} }
} }
return (ISubSystemConfiguration[])v.toArray(new ISubSystemConfiguration[v.size()]); ISubSystemConfiguration[] result = new ISubSystemConfiguration[v.size()];
v.toArray(result);
return result;
} }
/** /**
* Return Vector of subsystem factories that apply to a given system connection * Return Vector of subsystem factories that apply to a given system connection
*/ */