From ab1e47edb4aaf58ceb2341dee25e189685bf15ab Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 12 Jan 2014 19:48:31 -0500 Subject: [PATCH] Fix retreiving an empty MAC address string on some devices --- .../src/com/limelight/nvstream/NvConnection.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/moonlight-common/src/com/limelight/nvstream/NvConnection.java b/moonlight-common/src/com/limelight/nvstream/NvConnection.java index afdb97d1..67848486 100644 --- a/moonlight-common/src/com/limelight/nvstream/NvConnection.java +++ b/moonlight-common/src/com/limelight/nvstream/NvConnection.java @@ -62,7 +62,8 @@ public class NvConnection { NetworkInterface iface = ifaceList.nextElement(); if (iface.getName().startsWith("wlan") && - iface.getHardwareAddress() != null) { + iface.getHardwareAddress() != null && + iface.getHardwareAddress().length > 0) { selectedIface = iface; } } @@ -73,7 +74,8 @@ public class NvConnection { NetworkInterface iface = ifaceList.nextElement(); if (iface.getName().startsWith("eth") && - iface.getHardwareAddress() != null) { + iface.getHardwareAddress() != null && + iface.getHardwareAddress().length > 0) { selectedIface = iface; } } @@ -83,7 +85,8 @@ public class NvConnection { while (selectedIface == null && ifaceList.hasMoreElements()) { NetworkInterface iface = ifaceList.nextElement(); - if (iface.getHardwareAddress() != null) { + if (iface.getHardwareAddress() != null && + iface.getHardwareAddress().length > 0) { selectedIface = iface; break; }