diff --git a/src/main/java/io/jenkins/plugins/bitbucketpushandpullrequest/action/BitBucketPPRPullRequestServerAction.java b/src/main/java/io/jenkins/plugins/bitbucketpushandpullrequest/action/BitBucketPPRPullRequestServerAction.java index 7bc59de..5636fe7 100644 --- a/src/main/java/io/jenkins/plugins/bitbucketpushandpullrequest/action/BitBucketPPRPullRequestServerAction.java +++ b/src/main/java/io/jenkins/plugins/bitbucketpushandpullrequest/action/BitBucketPPRPullRequestServerAction.java @@ -88,7 +88,7 @@ public BitBucketPPRPullRequestServerAction(@Nonnull BitBucketPPRPayload payload) } } - if (!globalConfig.getPropagationUrl().isEmpty()) { + if (globalConfig.isPropagationUrlSet()) { try { this.baseUrl = new URL(globalConfig.getPropagationUrl()); } catch (MalformedURLException e) { diff --git a/src/main/java/io/jenkins/plugins/bitbucketpushandpullrequest/config/BitBucketPPRPluginConfig.java b/src/main/java/io/jenkins/plugins/bitbucketpushandpullrequest/config/BitBucketPPRPluginConfig.java index 1928ef8..3bf9396 100644 --- a/src/main/java/io/jenkins/plugins/bitbucketpushandpullrequest/config/BitBucketPPRPluginConfig.java +++ b/src/main/java/io/jenkins/plugins/bitbucketpushandpullrequest/config/BitBucketPPRPluginConfig.java @@ -101,6 +101,10 @@ public String getPropagationUrl() { return propagationUrl; } + public boolean isPropagationUrlSet() { + return !isEmpty(propagationUrl); + } + @DataBoundSetter public void setNotifyBitBucket(@CheckForNull boolean notifyBitBucket) { this.notifyBitBucket = notifyBitBucket;