Skip to content
Snippets Groups Projects
Commit cb021837 authored by hwchiu's avatar hwchiu
Browse files

Add the condition check avoid NullException when user delete a non-exist

hosts
parent b6cb49a8
No related branches found
No related tags found
No related merge requests found
......@@ -250,9 +250,10 @@ public class VirtualNetworkFilter
if (mac == null && port == null) return;
if (port != null) {
MACAddress host = portToMac.remove(port);
if(vNetsByGuid.get(macToGuid.get(host)) != null)
if(host !=null && vNetsByGuid.get(macToGuid.get(host)) != null)
vNetsByGuid.get(macToGuid.get(host)).removeHost(host);
macToGuid.remove(host);
if(host !=null)
macToGuid.remove(host);
} else if (mac != null) {
if (!portToMac.isEmpty()) {
for (Entry<String, MACAddress> entry : portToMac.entrySet()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment