From a8c1568b3757bb71dc0a9d087b98ac922e6c629c Mon Sep 17 00:00:00 2001 From: Koushik Das Date: Tue, 3 Jul 2012 18:52:36 +0530 Subject: [PATCH] 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. --- server/src/com/cloud/network/NetworkManagerImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index 2f3974c41a9..fc3124252b8 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -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);