mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Fix an NPE when there are no toolchains defined.
This commit is contained in:
parent
49283fae51
commit
2eaa4d0ff6
1 changed files with 11 additions and 10 deletions
|
@ -320,20 +320,21 @@ public class ManagedBuildManager extends AbstractCExtension {
|
|||
// To Do
|
||||
|
||||
// Create the array and copy the elements over
|
||||
int size = projectTypes != null ?
|
||||
projectTypes.size() + (definedTypes != null ? definedTypes.size() : 0) :
|
||||
0;
|
||||
int size = projectTypes != null ? projectTypes.size() : 0;
|
||||
size += definedTypes != null ? definedTypes.size() : 0;
|
||||
|
||||
IProjectType[] types = new IProjectType[size];
|
||||
|
||||
int n = 0;
|
||||
for (int i = 0; i < projectTypes.size(); ++i)
|
||||
types[n++] = (IProjectType)projectTypes.get(i);
|
||||
if (size > 0) {
|
||||
int n = 0;
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue