aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/bitbucketpullrequestbuilder
diff options
context:
space:
mode:
authorMaxim Epishchev <epishev@garant.ru>2016-02-04 10:59:33 +0300
committerMaxim Epishchev <epishev@garant.ru>2016-02-04 10:59:33 +0300
commit4c667ab93e7e4fd57ac2b38a423447072d1606ed (patch)
tree8b093d2b7a91741e114d1471331dd7b74744c7c1 /src/main/java/bitbucketpullrequestbuilder
parent340c1c44bad78992ec49746d3776c3cff1a96fbd (diff)
downloadbbprb-4c667ab93e7e4fd57ac2b38a423447072d1606ed.tar.gz
Allow default "none" credential in BitbucketRepository::getCredentials()
Using by default only username and passwords fields to provide BitBucket auth cause NullReferenceException in BitbucketRepository::getCredentials(), because credentialsId is null. It's my fault :(
Diffstat (limited to 'src/main/java/bitbucketpullrequestbuilder')
-rw-r--r--src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java
index 8439eea..3bc3928 100644
--- a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java
+++ b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java
@@ -303,6 +303,7 @@ public class BitbucketRepository {
}
private StandardUsernamePasswordCredentials getCredentials(String credentialsId) {
+ if (null == credentialsId) return null;
return CredentialsMatchers
.firstOrNull(
CredentialsProvider.lookupCredentials(StandardUsernamePasswordCredentials.class),