Skip to content

Commit

Permalink
[FIXED JENKINS-14266] check unset variable
Browse files Browse the repository at this point in the history
if env.expand don't expand a variable, this means this one has not been set, then should not break trying to parse, just ignore and let the "optional" plugin parameter fail the build if necessary
  • Loading branch information
ndeloof committed Apr 17, 2013
1 parent 4203fe7 commit c9c5de1
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -48,7 +48,9 @@ public String getBuildNumber() {

@Override
public Run<?,?> getBuild(Job<?,?> job, EnvVars env, BuildFilter filter, Run<?,?> parent) {
Run<?,?> run = job.getBuildByNumber(Integer.parseInt(env.expand(buildNumber)));
String buildNumber = env.expand(buildNumber);
if (buildNumber.startsWith('$')) return null; // unresolved variable, probably unset
Run<?,?> run = job.getBuildByNumber(Integer.parseInt(buildNumber));
return (run != null && filter.isSelectable(run, env)) ? run : null;
}

Expand Down

1 comment on commit c9c5de1

@buildhive
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jenkins » copyartifact-plugin #31 FAILURE
Looks like this commit caused a build failure
(what's this?)

Please sign in to comment.