Fixes NPE while creating Neutron Router without any interface
(subnet) attached to it.
Also removes a redundant null check
Change-Id: I9490d673c25771036ec93e19b9e9dee50bd53115
Signed-off-by: Abhinav Gupta <abhinav.gupta@ericsson.com>
subnetId = ip.getSubnetId();
Subnetmap subnetmap = nvpnManager.updateSubnetNode(subnetId, null, null, null, null, null, port.getUuid());
- if (vpnId == null && subnetmap != null) {
+ if (subnetmap != null) {
vpnId = subnetmap.getVpnId();
}
}
if (router != null) {
List<org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.routers.attributes.routers.router
.Interfaces> interfacesList = router.getInterfaces();
- if (!interfacesList.isEmpty()) {
+ if (interfacesList != null) {
for (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l3.rev150712.routers.attributes.routers
.router.Interfaces interfaces : interfacesList) {
subnetIdList.add(interfaces.getSubnetId());