Add null checks

This commit is contained in:
Roman Terentiev
2017-05-16 12:27:57 +03:00
parent e693542693
commit 7ee15a4f2a

View File

@@ -444,8 +444,13 @@ public class JGitEnvironmentRepository extends AbstractScmEnvironmentRepository
private void configureCommand(TransportCommand<?, ?> command) {
command.setTimeout(this.timeout);
command.setTransportConfigCallback(this.transportConfigCallback);
command.setCredentialsProvider(getCredentialsProvider());
if (this.transportConfigCallback != null) {
command.setTransportConfigCallback(this.transportConfigCallback);
}
CredentialsProvider credentialsProvider = getCredentialsProvider();
if (credentialsProvider != null) {
command.setCredentialsProvider(credentialsProvider);
}
}
private CredentialsProvider getCredentialsProvider() {