summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/openslx/network/StaticProxySelector.java26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/main/java/org/openslx/network/StaticProxySelector.java b/src/main/java/org/openslx/network/StaticProxySelector.java
index de872d9..b957728 100644
--- a/src/main/java/org/openslx/network/StaticProxySelector.java
+++ b/src/main/java/org/openslx/network/StaticProxySelector.java
@@ -41,19 +41,23 @@ public class StaticProxySelector extends ProxySelector
List<NetworkInterface> nWI = getNetworkInterfaces();
- // iterate over network interfaces and check for InetAddresses.
- for ( int i = 0; i < nWI.size(); ++i ) {
- Enumeration e = nWI.get( i ).getInetAddresses();
- // iterate over InetAddresses of current interface.
- while ( e.hasMoreElements() ) {
- InetAddress address = (InetAddress)e.nextElement();
- // Add proxy to list, if host do not equals to address.
- if ( ! ( host.equals( address ) ) &&
- ! ( host.startsWith( "127." ) ) &&
- ! ( host.equals( "localhost" ) ) ) {
- proxyList.add( this.proxy );
+ if ( nWI != null ) {
+ // iterate over network interfaces and check for InetAddresses.
+ for ( int i = 0; i < nWI.size(); ++i ) {
+ Enumeration e = nWI.get( i ).getInetAddresses();
+ // iterate over InetAddresses of current interface.
+ while ( e.hasMoreElements() ) {
+ InetAddress address = (InetAddress)e.nextElement();
+ // Add proxy to list, if host do not equals to address.
+ if ( ! ( host.equals( address ) ) &&
+ ! ( host.startsWith( "127." ) ) &&
+ ! ( host.equals( "localhost" ) ) ) {
+ proxyList.add( this.proxy );
+ }
}
}
+ } else if ( ! ( host.startsWith( "127." ) ) && ! ( host.equals( "localhost" ) ) ) {
+ proxyList.add( this.proxy );
}
// log.info( "proxyList: " + proxyList.toString() );
return proxyList;