Skip to content

Commit 89055d5

Browse files
committed
Check if null for NetworkInterface.getDisplayName().
Only set display name to protocol buffer Configuration object if the value is not null.
1 parent 6f47797 commit 89055d5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

kinetic-simulator/src/main/java/com/seagate/kinetic/simulator/utility/ConfigurationUtil.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ public static Configuration getConfiguration(SimulatorEngine engine)
8484
NetworkInterface ni = netInterfaces.nextElement();
8585

8686
itf1 = Interface.newBuilder();
87-
itf1.setName(ni.getDisplayName());
87+
88+
// display name could be null returned from NetworkInterface API
89+
if (ni.getDisplayName() != null) {
90+
itf1.setName(ni.getDisplayName());
91+
}
8892

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

0 commit comments

Comments
 (0)