mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Bug 485549 - prevent ArrayIndexOutOfBoundsException if no services are
installed. Change-Id: I96249643103ea9427b1c5d165d8854e50984f614 Signed-off-by: Greg Watson <g.watson@computer.org>
This commit is contained in:
parent
731be3a50e
commit
1b155ec4eb
1 changed files with 10 additions and 8 deletions
|
@ -386,16 +386,18 @@ public class ConnectionsPreferencePage extends PreferencePage implements IWorkbe
|
|||
fCloseButton.addSelectionListener(fEventHandler);
|
||||
fCloseButton.setEnabled(false);
|
||||
|
||||
String id = Preferences.getString(IRemotePreferenceConstants.PREF_CONNECTION_TYPE_ID);
|
||||
if ("".equals(id)) { //$NON-NLS-1$
|
||||
id = fServiceIDs[0];
|
||||
}
|
||||
for (int i = 0; i < fServiceIDs.length; i++) {
|
||||
if (id.equals(fServiceIDs[i])) {
|
||||
fServicesCombo.select(i);
|
||||
if (fServiceIDs.length > 0) {
|
||||
String id = Preferences.getString(IRemotePreferenceConstants.PREF_CONNECTION_TYPE_ID);
|
||||
if ("".equals(id)) { //$NON-NLS-1$
|
||||
id = fServiceIDs[0];
|
||||
}
|
||||
for (int i = 0; i < fServiceIDs.length; i++) {
|
||||
if (id.equals(fServiceIDs[i])) {
|
||||
fServicesCombo.select(i);
|
||||
}
|
||||
}
|
||||
selectServices(id);
|
||||
}
|
||||
selectServices(id);
|
||||
|
||||
return preferencePane;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue