[ONOS-3159] fix a concurrency issue in DHCPRelay.java

Change-Id: Ib9bc5d0f0e788ceabc5272a05ac52a6753a3a229
diff --git a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/DhcpRelay.java b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/DhcpRelay.java
index 0bb5dff..273e32b 100644
--- a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/DhcpRelay.java
+++ b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/DhcpRelay.java
@@ -384,6 +384,10 @@
             MacAddress descMac = new MacAddress(dhcpPayload.getClientHardwareAddress());
             Host host = hostService.getHost(HostId.hostId(descMac,
                     VlanId.vlanId(ethPacket.getVlanID())));
+            //handle the concurrent host offline scenario
+            if (host == null) {
+                return;
+            }
             ConnectPoint dhcpRequestor = new ConnectPoint(host.location().elementId(),
                                                     host.location().port());
 
@@ -414,4 +418,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}