1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

bug 342609: NPE in ChangeBuildConfigActionBase

This commit is contained in:
Andrew Gvozdev 2011-04-12 16:45:19 +00:00
parent 69e391fbe1
commit ca1d3510c6

View file

@ -254,25 +254,27 @@ public class ChangeBuildConfigActionBase {
if (!badObject && !fProjects.isEmpty()) { if (!badObject && !fProjects.isEmpty()) {
Iterator<IProject> iter = fProjects.iterator(); Iterator<IProject> iter = fProjects.iterator();
ICConfigurationDescription[] firstConfigs = getCfgs(iter.next()); ICConfigurationDescription[] firstConfigs = getCfgs(iter.next());
for (ICConfigurationDescription firstConfig : firstConfigs) { if (firstConfigs!=null) {
boolean common = true; for (ICConfigurationDescription firstConfig : firstConfigs) {
Iterator<IProject> iter2 = fProjects.iterator(); boolean common = true;
while (iter2.hasNext()) { Iterator<IProject> iter2 = fProjects.iterator();
ICConfigurationDescription[] currentConfigs = getCfgs(iter2.next()); while (iter2.hasNext()) {
int j = 0; ICConfigurationDescription[] currentConfigs = getCfgs(iter2.next());
for (; j < currentConfigs.length; j++) { int j = 0;
if (firstConfig.getName().equals(currentConfigs[j].getName())) for (; j < currentConfigs.length; j++) {
if (firstConfig.getName().equals(currentConfigs[j].getName()))
break;
}
if (j == currentConfigs.length) {
common = false;
break; break;
}
} }
if (j == currentConfigs.length) { if (common) {
common = false; enable = true;
break; break;
} }
} }
if (common) {
enable = true;
break;
}
} }
} }
action.setEnabled(enable); action.setEnabled(enable);