commit | 6e66a305c86ca9fa6f5eeb1bec3bad89abb7debd | [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 12:56:30 2021 +0000 |
tree | 4095fe6991d20abeff8a24fa4319c39ef4169be5 | |
parent | 55f857a02e07bde1001c032f972a6b8eec562f2b [diff] |
Fix: resolve a NPE due to non-existing annotation in POD definition Change-Id: I5e17e800b71bd329db46f62d5d0304fde40754e9 (cherry picked from commit 840156cc4ee9fbdde9a5ab877977312943382e62)
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) {