1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-31 21:05:37 +02:00

Fix an NPE when there are no toolchains defined.

This commit is contained in:
Doug Schaefer 2008-04-23 01:41:18 +00:00
parent 49283fae51
commit 2eaa4d0ff6

View file

@ -320,20 +320,21 @@ public class ManagedBuildManager extends AbstractCExtension {
// To Do // To Do
// Create the array and copy the elements over // Create the array and copy the elements over
int size = projectTypes != null ? int size = projectTypes != null ? projectTypes.size() : 0;
projectTypes.size() + (definedTypes != null ? definedTypes.size() : 0) : size += definedTypes != null ? definedTypes.size() : 0;
0;
IProjectType[] types = new IProjectType[size]; IProjectType[] types = new IProjectType[size];
int n = 0; if (size > 0) {
for (int i = 0; i < projectTypes.size(); ++i) int n = 0;
types[n++] = (IProjectType)projectTypes.get(i); for (int i = 0; i < projectTypes.size(); ++i)
types[n++] = (IProjectType)projectTypes.get(i);
if (definedTypes != null)
for (int i = 0; i < definedTypes.size(); ++i)
types[n++] = definedTypes.get(i);
}
if (definedTypes != null)
for (int i = 0; i < definedTypes.size(); ++i)
types[n++] = definedTypes.get(i);
return types; return types;
} }