aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWynand Pieters <duhblinn+github@gmail.com>2017-02-10 13:32:58 +0200
committerGitHub <noreply@github.com>2017-02-10 13:32:58 +0200
commit70b0715f8fd847b001756da3707110c52e9f50b3 (patch)
treea84274af90c9b0291e4cccf7c51127441413d590 /src
parenta352fbf76c5ce320f88de7a2e38476d0d0547845 (diff)
downloadbbprb-70b0715f8fd847b001756da3707110c52e9f50b3.tar.gz
Fix `null/null` repository URL
On the latest version I started getting these errors in the logs and my jobs would trigger every minute and never flag the build as having run before. ``` POST state INPROGRESS to https://bitbucket.org/api/2.0/repositories/null/null/commit/b6f8169ce460/statuses/build with key 515f53a20bf37bd484f2be5cda6ab168cd194cee with response {"type": "error", "error": {"message": "Repository null/null not found"}} ``` Functionality in `getOwnerName` and `getRepositoryName` name changed from previous versions, moved to inside `setFullName` which is now doing the `if` on the wrong value. This causes `null/null` to be set as the owner name / repo name.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/bitbucket/Pullrequest.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/bitbucket/Pullrequest.java b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/bitbucket/Pullrequest.java
index 96412b2..25755a4 100644
--- a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/bitbucket/Pullrequest.java
+++ b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/bitbucket/Pullrequest.java
@@ -114,7 +114,7 @@ public class Pullrequest {
@JsonProperty("full_name")
public void setFullName(String fullName) {
// Also extract owner- and reponame
- if (name != null) {
+ if (fullName != null) {
this.ownerName = fullName.split("/")[0];
this.repositoryName = fullName.split("/")[1];
}