From 4c667ab93e7e4fd57ac2b38a423447072d1606ed Mon Sep 17 00:00:00 2001 From: Maxim Epishchev Date: Thu, 4 Feb 2016 10:59:33 +0300 Subject: 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 :( --- .../bitbucketpullrequestbuilder/BitbucketRepository.java | 1 + 1 file changed, 1 insertion(+) 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), -- cgit v1.2.3