Thomas Vachuska
Committed by Gerrit Code Review

Fixed an NPE in device manager/provider.

Change-Id: I0240bc6f591881efefc1043eb620068d6ab2d9a4
......@@ -18,6 +18,7 @@ package org.onosproject.net.device.impl;
import static com.google.common.base.Preconditions.checkNotNull;
import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor;
import static org.onlab.util.Tools.groupedThreads;
import static org.onlab.util.Tools.nullIsNotFound;
import static org.onosproject.net.MastershipRole.MASTER;
import static org.onosproject.net.MastershipRole.NONE;
import static org.onosproject.net.MastershipRole.STANDBY;
......@@ -435,7 +436,7 @@ public class DeviceManager
portDescription);
return;
}
final Device device = getDevice(deviceId);
Device device = nullIsNotFound(getDevice(deviceId), "Device not found");
if ((Device.Type.ROADM.equals(device.type()))) {
Port port = getPort(deviceId, portDescription.portNumber());
portDescription = OpticalPortOperator.descriptionOf(port, portDescription.isEnabled());
......
......@@ -377,7 +377,6 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
public void receivedRoleReply(Dpid dpid, RoleState requested, RoleState response) {
MastershipRole request = roleOf(requested);
MastershipRole reply = roleOf(response);
providerService.receivedRoleReply(deviceId(uri(dpid)), request, reply);
}
......