Commit 89055d53 authored by chiaming2000's avatar chiaming2000
Browse files

Check if null for NetworkInterface.getDisplayName().

Only set display name to protocol buffer Configuration object if the
value is not null.
parent 6f47797c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -84,7 +84,11 @@ public abstract class ConfigurationUtil {
                NetworkInterface ni = netInterfaces.nextElement();

                itf1 = Interface.newBuilder();
                
                // display name could be null returned from NetworkInterface API
                if (ni.getDisplayName() != null) {
                    itf1.setName(ni.getDisplayName());
                }

                // set mac addr
                byte[] mac = ni.getHardwareAddress();