Fix for CS-15345

During account cleanup, associated network is accessed without checking whether it is present or not. Added a check to use it only when present.
This commit is contained in:
Koushik Das 2012-07-03 18:52:36 +05:30
parent 079d7ef1aa
commit a8c1568b37
1 changed files with 4 additions and 1 deletions

View File

@ -1299,8 +1299,11 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
s_logger.debug("Releasing ip id=" + addrId + "; sourceNat = " + ip.isSourceNat());
}
Network network = null;
if (ip.getAssociatedWithNetworkId() != null) {
Network network = _networksDao.findById(ip.getAssociatedWithNetworkId());
network = _networksDao.findById(ip.getAssociatedWithNetworkId());
}
if (network != null) {
try {
if (!applyIpAssociations(network, true)) {
s_logger.warn("Unable to apply ip address associations for " + network);