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:
parent
49283fae51
commit
2eaa4d0ff6
1 changed files with 11 additions and 10 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue