diff options
author | Max <maxvodo@users.noreply.github.com> | 2016-02-04 11:12:34 +0300 |
---|---|---|
committer | Max <maxvodo@users.noreply.github.com> | 2016-02-04 11:12:34 +0300 |
commit | 56a5bbf2bad838cb1cc7b39021d865f6a97d8745 (patch) | |
tree | 8b093d2b7a91741e114d1471331dd7b74744c7c1 /src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java | |
parent | 4b880c7045ebf42974f833ffe9b11084c86c3408 (diff) | |
parent | 4c667ab93e7e4fd57ac2b38a423447072d1606ed (diff) | |
download | bbprb-56a5bbf2bad838cb1cc7b39021d865f6a97d8745.tar.gz |
Merge pull request #10 from maxvodo/fix-null-reference-credentialsId
Merge 'fix-null-reference-credentialsId' into master
Diffstat (limited to 'src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java')
-rw-r--r-- | src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java index 23b0607..3bc3928 100644 --- a/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java +++ b/src/main/java/bitbucketpullrequestbuilder/bitbucketpullrequestbuilder/BitbucketRepository.java @@ -9,18 +9,22 @@ import java.util.logging.Logger; import bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.bitbucket.ApiClient; import bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.bitbucket.BuildState; import bitbucketpullrequestbuilder.bitbucketpullrequestbuilder.bitbucket.Pullrequest; + import java.util.LinkedList; import java.util.logging.Level; import java.util.regex.Matcher; import java.util.regex.Pattern; + import com.cloudbees.plugins.credentials.CredentialsMatchers; import com.cloudbees.plugins.credentials.CredentialsProvider; import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials; import com.cloudbees.plugins.credentials.common.UsernamePasswordCredentials; + import jenkins.model.Jenkins; import jenkins.scm.api.SCMSource; import jenkins.scm.api.SCMSourceOwner; import jenkins.scm.api.SCMSourceOwners; + import org.apache.commons.lang.StringUtils; import static com.cloudbees.plugins.credentials.CredentialsMatchers.instanceOf; @@ -299,6 +303,7 @@ public class BitbucketRepository { } private StandardUsernamePasswordCredentials getCredentials(String credentialsId) { + if (null == credentialsId) return null; return CredentialsMatchers .firstOrNull( CredentialsProvider.lookupCredentials(StandardUsernamePasswordCredentials.class), |