Skip to content

Commit

Permalink
[JENKINS-45471] Not add null values to the list (#114)
Browse files Browse the repository at this point in the history
* [JENKINS-45471] Not add null values to the list

* [JENKINS-45471] Add a logger in the else
  • Loading branch information
fbelzunc authored and oleg-nenashev committed Jul 12, 2017
1 parent 59a3463 commit 59e30a2
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -387,6 +387,7 @@ public List<Future<AbstractBuild>> perform(AbstractBuild<?, ?> build, Launcher l

try {
if (condition.isMet(build.getResult())) {
Future future = null;
List<Future<AbstractBuild>> futures = new ArrayList<Future<AbstractBuild>>();

for (List<AbstractBuildParameters> addConfigs : getDynamicBuildParameters(build, listener)) {
Expand All @@ -395,8 +396,13 @@ public List<Future<AbstractBuild>> perform(AbstractBuild<?, ?> build, Launcher l
build, listener);
for (Job project : getJobs(build.getRootBuild().getProject().getParent(), env)) {
List<Action> list = getBuildActions(actions, project);

futures.add(schedule(build, project, list, listener));
//Future can be null as schedule can return null
future = schedule(build, project, list, listener);
if (future != null) {
futures.add(future);
} else {
LOGGER.log(Level.FINE, "The schedule for project {0} and build {1} failed due either security reasons or the trigger is not compatible with un-parameterized jobs", new Object[]{project.getFullName(), build.number});
}
}
}

Expand Down

0 comments on commit 59e30a2

Please sign in to comment.