Skip to content

Commit

Permalink
JENKINS-41459 fixes NPE when credential is null
Browse files Browse the repository at this point in the history
  • Loading branch information
James Dumay committed Jan 30, 2017
1 parent a26323e commit f371bd2
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 f371bd2

Please sign in to comment.