Skip to content

Commit

Permalink
Merge pull request #37 from i386/feature/JENKINS-41459
Browse files Browse the repository at this point in the history
JENKINS-41459 fixes NPE when credential is null
  • Loading branch information
p4paul committed Feb 6, 2017
2 parents 6be7850 + f371bd2 commit 33d41b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/org/jenkinsci/plugins/p4/PerforceScm.java
Expand Up @@ -215,8 +215,12 @@ public String getKey() {

@Override
public RepositoryBrowser<?> guessBrowser() {
String scmCredential = getCredential();
if (scmCredential == null) {
logger.fine("No credential for perforce");
return null;
}
try {
String scmCredential = getCredential();
ConnectionHelper connection = new ConnectionHelper(scmCredential, null);
String swarm = connection.getSwarm();
URL url = new URL(swarm);
Expand Down

0 comments on commit 33d41b3

Please sign in to comment.