Fix NPE in DhcpRelayManager

Change-Id: Iad6d266e314ad4d03a5e78d8d7b9780f0e904f70
This commit is contained in:
Charles Chan 2017-09-13 20:00:05 -07:00
parent bb86b78a34
commit a5b5b9cfdf

View File

@ -669,6 +669,11 @@ public class DhcpRelayManager implements DhcpRelayService {
private void deviceAdd(DeviceId deviceId) {
IgnoreDhcpConfig config = cfgService.getConfig(appId, IgnoreDhcpConfig.class);
if (config == null) {
log.debug("No ignoreVlan config found for {}. Do nothing.", deviceId);
return;
}
Collection<VlanId> vlanIds = config.ignoredVlans().get(deviceId);
vlanIds.forEach(vlanId -> {
processIgnoreVlanRule(deviceId, vlanId, ADD);