[ONOS-2874]update VTN's bug: delete dhcp port unsuccessfully

Change-Id: If85b9f0a6dd5b9714cacb931bd51c8fbd78fa5ed
diff --git a/apps/vtn/src/main/java/org/onosproject/vtn/impl/VTNManager.java b/apps/vtn/src/main/java/org/onosproject/vtn/impl/VTNManager.java
index ba4745b..090ef0f 100644
--- a/apps/vtn/src/main/java/org/onosproject/vtn/impl/VTNManager.java
+++ b/apps/vtn/src/main/java/org/onosproject/vtn/impl/VTNManager.java
@@ -21,11 +21,12 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.ScheduledExecutorService;
+import java.util.stream.Collectors;
 
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
@@ -608,14 +609,20 @@
     private Iterable<String> getIfaceIds(String ifaceId) {
         VirtualPortId portId = VirtualPortId.portId(ifaceId);
         VirtualPort port = virtualPortService.getPort(portId);
+        if (port == null) {
+            return Collections.emptyList();
+        }
+
         TenantNetwork network = tenantNetworkService
                 .getNetwork(port.networkId());
-        Collection<String> ifaceIds = new HashSet<>();
+        if (network == null) {
+            return Collections.emptyList();
+        }
+
         Collection<VirtualPort> ports = virtualPortService
                 .getPorts(network.id());
-        Sets.newHashSet(ports).stream()
-                .forEach(p -> ifaceIds.add(p.portId().portId()));
-        return ifaceIds;
+        return ports.stream().map(p -> p.portId().portId())
+                .collect(Collectors.toSet());
     }
 
     private List<PortNumber> getLocalPorts(DeviceId deviceId, String ifaceId) {