Skip to content
Browse files
[FIXED JENKINS-14266] check unset variable
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 fe01ca92d38a088a8349ad9c9b5c9449b56d065a
Binary file not shown.
@@ -48,7 +48,9 @@ public String getBuildNumber() {

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;

1 comment on commit fe01ca9


This comment has been minimized.

Copy link

@jglick jglick commented on fe01ca9 Apr 26, 2013

Delete the

Please sign in to comment.