fix for NPE in JakartaHttpClient.setProxy

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5045 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
danielr 2008-08-10 09:37:32 +00:00
parent bb6a6fc233
commit f2d0bd7790

View File

@ -444,12 +444,14 @@ public class JakartaCommonsHttpClient {
throw e;
}
final httpRemoteProxyConfig hostProxyConfig = getProxyConfig(host);
final String scheme = method.getURI().getScheme();
if(scheme != null && scheme.toLowerCase().startsWith("https") && !hostProxyConfig.useProxy4SSL()) {
// do not use proxy for HTTPS
return null;
if(hostProxyConfig != null) {
final String scheme = method.getURI().getScheme();
if(scheme != null && scheme.toLowerCase().startsWith("https") && !hostProxyConfig.useProxy4SSL()) {
// do not use proxy for HTTPS
return null;
}
addProxyAuth(method, hostProxyConfig);
}
addProxyAuth(method, hostProxyConfig);
return hostProxyConfig;
}