From d7e6b4560cb4d5f9a1da7482a1458caa790a08c4 Mon Sep 17 00:00:00 2001 From: BetaSteward Date: Tue, 6 Sep 2011 09:37:05 -0400 Subject: [PATCH] fixed Issue 243 --- Mage.Common/src/mage/remote/Connection.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Mage.Common/src/mage/remote/Connection.java b/Mage.Common/src/mage/remote/Connection.java index e120a1ed60..49a9dd66e3 100644 --- a/Mage.Common/src/mage/remote/Connection.java +++ b/Mage.Common/src/mage/remote/Connection.java @@ -183,12 +183,13 @@ public class Connection { NetworkInterface iface = interfaces.nextElement( ); if (iface.isLoopback()) continue; - for (InterfaceAddress addr: iface.getInterfaceAddresses()) - { - InetAddress iaddr = addr.getAddress(); - if (iaddr instanceof Inet4Address) { - return iaddr; - } + for (InterfaceAddress addr: iface.getInterfaceAddresses()) { + if (addr != null) { + InetAddress iaddr = addr.getAddress(); + if (iaddr != null && iaddr instanceof Inet4Address) { + return iaddr; + } + } } } return null;