Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fix for NPE in JakartaHttpClient.setProxy

danielrf2d0bd779013
diff --git a/source/de/anomic/http/JakartaCommonsHttpClient.java b/source/de/anomic/http/JakartaCommonsHttpClient.java
index 3770395be..1b2005a76 100644
--- a/source/de/anomic/http/JakartaCommonsHttpClient.java
+++ b/source/de/anomic/http/JakartaCommonsHttpClient.java
@@ -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;
}