bug 7172: this npe occurs when we try and delete rules on a router which does not exist. fixing the same.

status 7172: resolved fixed
This commit is contained in:
abhishek 2010-11-13 09:27:53 -08:00
parent bfed53ab3a
commit fe1f2824a4
1 changed files with 3 additions and 1 deletions

View File

@ -1401,11 +1401,13 @@ public class NetworkManagerImpl implements NetworkManager, VirtualMachineManager
}
final DomainRouterVO router = _routerDao.findBy(ipVO.getAccountId(), ipVO.getDataCenterId());
Long hostId = router.getHostId();
if (router == null || router.getHostId() == null) {
return true;
}
Long hostId = router.getHostId();
if (rule.isForwarding()) {
return updatePortForwardingRule(rule, router, hostId, oldPrivateIP, oldPrivatePort);
} else {