Permalink
Browse files

Incorporated changes suggested by ssogabe

  • Loading branch information...
1 parent 9b8c399 commit e88bf5d38dbe00274bbdeea646fd7747042f06ee @petehayes committed Feb 11, 2011
Showing with 7 additions and 5 deletions.
  1. +7 −5 src/main/java/hudson/plugins/promoted_builds/Promotion.java
@@ -67,11 +67,13 @@ public Status getStatus() {
@Override
public EnvVars getEnvironment(TaskListener listener) throws IOException, InterruptedException {
EnvVars e = super.getEnvironment(listener);
- String rootUrl = Hudson.getInstance().getRootUrl();
- if(rootUrl!=null && targetBuildNumber != 0)
- e.put("PROMOTED_URL",rootUrl+getTarget().getUrl());
- e.put("PROMOTED_JOB_NAME", getTarget().getParent().getName());
- e.put("PROMOTED_NUMBER", Integer.toString(targetBuildNumber));
+ if (targetBuildNumber != 0) {
+ String rootUrl = Hudson.getInstance().getRootUrl();
+ if(rootUrl!=null)
+ e.put("PROMOTED_URL",rootUrl+getTarget().getUrl());
+ e.put("PROMOTED_JOB_NAME", getTarget().getParent().getName());
+ e.put("PROMOTED_NUMBER", Integer.toString(targetBuildNumber));
+ }
return e;
}

0 comments on commit e88bf5d

Please sign in to comment.