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 fe01ca9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Binary file not shown.
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 fe01ca9

@jglick
Copy link
Member

@jglick jglick commented on fe01ca9 Apr 26, 2013

Choose a reason for hiding this comment

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

Delete the .SpecificBuildSelector.java.swp.

Please sign in to comment.