Yuta HIGUCHI

Ignore setRole if switch is not connected to that node.

Change-Id: I40fb0b768294926924b29c7715a91c95df9b9664
......@@ -169,7 +169,12 @@ public class OpenFlowControllerImpl implements OpenFlowController {
@Override
public void setRole(Dpid dpid, RoleState role) {
getSwitch(dpid).setRole(role);
final OpenFlowSwitch sw = getSwitch(dpid);
if (sw == null) {
log.debug("Switch not connected. Ignoring setRole({}, {})", dpid, role);
return;
}
sw.setRole(role);
}
/**
......