commit | 840156cc4ee9fbdde9a5ab877977312943382e62 | [log] [tgz] |
---|---|---|
author | Jian Li <pyguni@gmail.com> | Thu Jan 21 20:30:52 2021 +0900 |
committer | Jian Li <pyguni@gmail.com> | Thu Jan 21 20:30:52 2021 +0900 |
tree | 5e11110c9168798df2e30eb3123e501e9e5469bb | |
parent | 2b35ec765f5733cd3cf2cfe8802a7d873691d078 [diff] |
Fix: resolve a NPE due to non-existing annotation in POD definition Change-Id: I5e17e800b71bd329db46f62d5d0304fde40754e9
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 5e14817..d9ea01e 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
@@ -258,6 +258,10 @@ public static KubevirtPort getPort(Set<KubevirtNetwork> networks, Pod pod) { try { Map<String, String> annots = pod.getMetadata().getAnnotations(); + if (annots == null) { + return null; + } + String networkStatusStr = annots.get(NETWORK_STATUS_KEY); if (networkStatusStr == null) {