Skip to content

Commit 84bbeb8

Browse files
jimklimovjakub-bochenski
authored andcommitted
Stash Notifier Plugin doesn't set the Jenkins Root URL in stash
1 parent 015d12c commit 84bbeb8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ public void onCompleted(AbstractBuild build, TaskListener listener) {
4949
return;
5050
}
5151
Result result = build.getResult();
52-
JenkinsLocationConfiguration globalConfig = new JenkinsLocationConfiguration();
53-
String rootUrl = globalConfig.getUrl();
52+
// Note: current code should no longer use "new JenkinsLocationConfiguration()"
53+
// as only one instance per runtime is really supported by the current core.
54+
JenkinsLocationConfiguration globalConfig = JenkinsLocationConfiguration.get();
55+
String rootUrl = globalConfig == null ? null : globalConfig.getUrl();
5456
String buildUrl = "";
5557
if (rootUrl == null) {
5658
buildUrl = " PLEASE SET JENKINS ROOT URL FROM GLOBAL CONFIGURATION " + build.getUrl();

0 commit comments

Comments
 (0)