Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-49015] Groovy script is lost when upgrading the plugin
  • Loading branch information
Greybird committed Jan 27, 2018
1 parent 9ee54b6 commit f7fcc02
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/main/java/hudson/plugins/claim/ClaimConfig.java
Expand Up @@ -203,15 +203,20 @@ public static ClaimConfig get() {
}

@SuppressWarnings("deprecation")
@SuppressFBWarnings(
value = {"RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"},
justification = "during migration, field can be null")
private Object readResolve() {
// JENKINS-43811 migration logic
String script;
if (groovyScript != null) {
script = groovyScript;
} else {
script = "";
if (groovyTrigger == null) {
if (groovyScript != null) {
script = groovyScript;
} else {
script = "";
}
setGroovyTrigger(new SecureGroovyScript(script, true, null), false);
}
setGroovyTrigger(new SecureGroovyScript(script, true, null), false);
return this;
}
}

0 comments on commit f7fcc02

Please sign in to comment.