CLOUDSTACK-1315: Fix NPE when try to upgrade network from VR to SRX-F5

Still return a valid object when reverting non-existed rules.
This commit is contained in:
Sheng Yang 2013-03-06 16:49:44 -08:00
parent e31cd2b3d2
commit 27ba0208f0

View File

@ -819,7 +819,8 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
}
} else {
s_logger.debug("Revoking a rule for an inline load balancer that has not been programmed yet.");
return null;
nic.setNic(null);
return nic;
}
}
@ -877,9 +878,9 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
MappingNic nic = getLoadBalancingIpNic(zone, network, rule.getSourceIpAddressId(), revoked, null);
mappingStates.add(nic.getState());
NicVO loadBalancingIpNic = nic.getNic();
if (loadBalancingIpNic == null) {
continue;
}
if (loadBalancingIpNic == null) {
continue;
}
// Change the source IP address for the load balancing rule to be the load balancing IP address
srcIp = loadBalancingIpNic.getIp4Address();