commit | bc5787ee3d8421118c78a70ccce6e7787c462cf0 | [log] [tgz] |
---|---|---|
author | Jian Li <pyguni@gmail.com> | Tue Mar 19 20:49:10 2024 +0900 |
committer | Jian Li <pyguni@gmail.com> | Tue Mar 19 20:49:10 2024 +0900 |
tree | 5db892e7765bde1f525393d0669a789957d95c98 | |
parent | 09b40a75cc705ce3ccbe3c5913bbcd785421453b [diff] |
Fix: resolve a NPE caused by empty MAC info in interface object Change-Id: I8c926759faf6ce7d7ef38f1139921bf4a37f57c5
diff --git a/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/util/KubevirtNetworkingUtil.java b/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/util/KubevirtNetworkingUtil.java index 8b95507..d1ec93f 100644 --- a/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/util/KubevirtNetworkingUtil.java +++ b/apps/kubevirt-networking/app/src/main/java/org/onosproject/kubevirtnetworking/util/KubevirtNetworkingUtil.java
@@ -424,7 +424,7 @@ .filter(n -> (NETWORK_PREFIX + n.name()).equals(name) || (n.name() + "-net").equals(name)) .findAny().orElse(null); - if (network != null) { + if (network != null && interfaceJson.get(MAC) != null) { // FIXME: we do not update IP address, as learning IP address // requires much more time due to the lag from VM agent String mac = interfaceJson.get(MAC).asText();