mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-14 00:41:10 +02:00
check if a value in a map exists before dereference, avoid NPE
Change-Id: I9f5ef22e1fa5105cd9c1ee0d0a0b15c98f5a1abf
This commit is contained in:
parent
a349da9d6b
commit
e6a00f00bf
@ -463,8 +463,9 @@ public class NetconfDeviceProvider extends AbstractProvider
|
||||
if (isReachable && deviceService.isAvailable(deviceId) &&
|
||||
mastershipService.isLocalMaster(deviceId)) {
|
||||
//if ports are not discovered, retry the discovery
|
||||
AtomicInteger count = retriedPortDiscoveryMap.get(deviceId);
|
||||
if (deviceService.getPorts(deviceId).isEmpty() &&
|
||||
retriedPortDiscoveryMap.get(deviceId).getAndIncrement() < maxRetries) {
|
||||
count != null && count.getAndIncrement() < maxRetries) {
|
||||
discoverPorts(deviceId);
|
||||
}
|
||||
updatePortStatistics(device);
|
||||
|
Loading…
x
Reference in New Issue
Block a user