Skip to content
Permalink
Browse files

Fix JENKINS-20770

Used a local variable for the expanded presend script instead of
reassigning to the original variable
  • Loading branch information
unknown
unknown committed Nov 27, 2013
1 parent 8990a48 commit c6425f4c8457f458c7de2c6399471cb5a4588e6b
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/main/java/hudson/plugins/emailext/ExtendedEmailPublisher.java
@@ -377,8 +377,8 @@ private boolean sendMail(ExtendedEmailPublisherContext context) {
private boolean executePresendScript(ExtendedEmailPublisherContext context, MimeMessage msg)
throws RuntimeException {
boolean cancel = false;
presendScript = new ContentBuilder().transformText(presendScript, context, getRuntimeMacros(context));
if (StringUtils.isNotBlank(presendScript)) {
String script = new ContentBuilder().transformText(presendScript, context, getRuntimeMacros(context));
if (StringUtils.isNotBlank(script)) {
debug(context.getListener().getLogger(), "Executing pre-send script");
ClassLoader cl = Jenkins.getInstance().getPluginManager().uberClassLoader;
ScriptSandbox sandbox = null;
@@ -412,7 +412,7 @@ private boolean executePresendScript(ExtendedEmailPublisherContext context, Mime
}

try {
Object output = shell.evaluate(presendScript);
Object output = shell.evaluate(script);
if(output!=null) {
pw.println("Result: "+output);
cancel = ((Boolean)shell.getVariable("cancel")).booleanValue();

0 comments on commit c6425f4

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