Skip to content
Permalink
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 43452e9f003d09ff6210a841bcb6c315b8aef0c3
Binary file not shown.
@@ -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 num = env.expand(buildNumber);
if (num.startsWith("$")) return null; // unresolved variable, probably unset
Run<?,?> run = job.getBuildByNumber(Integer.parseInt(num));
return (run != null && filter.isSelectable(run, env)) ? run : null;
}

1 comment on commit 43452e9

@jglick

This comment has been minimized.

Copy link
Member

@jglick jglick commented on 43452e9 Apr 26, 2013

*.swp again

Please sign in to comment.
You can’t perform that action at this time.