hardened RoutingDatastoreInMemory against NPE

This commit is contained in:
Dmitry Toptygin
2020-06-01 22:27:39 -04:00
parent 171f5aaa1a
commit 21d4e91734

View File

@@ -331,7 +331,13 @@ public class RoutingDatastoreInMemory extends BaseInMemoryDatastore implements R
});
List<EquipmentGatewayRecord> ret = new ArrayList<>();
gwIds.forEach(id -> ret.add(idToGatewayMap.get(id).clone()));
gwIds.forEach(id -> {
EquipmentGatewayRecord gw = idToGatewayMap.get(id);
if(gw!=null) {
ret.add(gw.clone());
}
});
return ret;
}