1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-02 05:45:58 +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,12 +320,12 @@ 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];
if (size > 0) {
int n = 0; int n = 0;
for (int i = 0; i < projectTypes.size(); ++i) for (int i = 0; i < projectTypes.size(); ++i)
types[n++] = (IProjectType)projectTypes.get(i); types[n++] = (IProjectType)projectTypes.get(i);
@ -333,6 +333,7 @@ public class ManagedBuildManager extends AbstractCExtension {
if (definedTypes != null) if (definedTypes != null)
for (int i = 0; i < definedTypes.size(); ++i) for (int i = 0; i < definedTypes.size(); ++i)
types[n++] = definedTypes.get(i); types[n++] = definedTypes.get(i);
}
return types; return types;
} }