Skip to content

Commit 422eab9

Browse files
jimklimovJakub Bocheński
authored andcommitted
StashBuilds.java : try again before asking to "PLEASE SET JENKINS ROOT URL FROM GLOBAL CONFIGURATION"
1 parent 015d12c commit 422eab9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/stashpullrequestbuilder/stashpullrequestbuilder/StashBuilds.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ public void onCompleted(AbstractBuild build, TaskListener listener) {
5252
JenkinsLocationConfiguration globalConfig = new JenkinsLocationConfiguration();
5353
String rootUrl = globalConfig.getUrl();
5454
String buildUrl = "";
55+
if (rootUrl == null) {
56+
// Get hold of the currently active config, if this version
57+
// of Jenkins core returns an empty one as new()
58+
globalConfig = JenkinsLocationConfiguration.get();
59+
rootUrl = globalConfig.getUrl();
60+
}
5561
if (rootUrl == null) {
5662
buildUrl = " PLEASE SET JENKINS ROOT URL FROM GLOBAL CONFIGURATION " + build.getUrl();
5763
}

0 commit comments

Comments
 (0)