Skip to content

Commit d17183e

Browse files
author
angelozerr
committed
Fix bug with tslint repository.
1 parent 6c16109 commit d17183e

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

eclipse/ts.eclipse.ide.ui/src/ts/eclipse/ide/internal/ui/preferences/AbstractTypeScriptRepositoryConfigurationBlock.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
*/
1111
package ts.eclipse.ide.internal.ui.preferences;
1212

13+
import java.util.ArrayList;
14+
import java.util.List;
15+
1316
import org.eclipse.core.resources.IProject;
1417
import org.eclipse.jface.dialogs.ControlEnableState;
1518
import org.eclipse.swt.SWT;
@@ -111,15 +114,18 @@ public void widgetSelected(SelectionEvent e) {
111114

112115
// Create combo of embedded node.js
113116
ITypeScriptRepository[] respositories = TypeScriptCorePlugin.getTypeScriptRepositoryManager().getRepositories();
114-
String[] values = new String[respositories.length];
115-
String[] labels = new String[respositories.length];
116-
int i = 0;
117+
List<String> values = new ArrayList<String>();
118+
List<String> labels = new ArrayList<String>();
119+
String label = null;
117120
for (ITypeScriptRepository repository : respositories) {
118-
values[i] = repository.getName();
119-
labels[i] = getRepositoryLabel(repository);
120-
i++;
121+
label = getRepositoryLabel(repository);
122+
if (label != null) {
123+
values.add(repository.getName());
124+
labels.add(label);
125+
}
121126
}
122-
embeddedComboBox = newComboControl(parent, getEmbeddedTypescriptKey(), values, labels);
127+
embeddedComboBox = newComboControl(parent, getEmbeddedTypescriptKey(),
128+
values.toArray(new String[values.size()]), labels.toArray(new String[labels.size()]));
123129
embeddedComboBox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
124130
}
125131

@@ -138,8 +144,8 @@ public void widgetSelected(SelectionEvent e) {
138144
}
139145
});
140146

141-
installedComboBox = newComboControl(parent, getInstalledTypescriptPathKey(), getDefaultPaths(), getDefaultPaths(),
142-
false);
147+
installedComboBox = newComboControl(parent, getInstalledTypescriptPathKey(), getDefaultPaths(),
148+
getDefaultPaths(), false);
143149
installedComboBox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
144150

145151
// Create Browse buttons.

0 commit comments

Comments
 (0)