diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java index b3f543d236e..290c8280104 100755 --- a/server/src/com/cloud/user/AccountManagerImpl.java +++ b/server/src/com/cloud/user/AccountManagerImpl.java @@ -867,10 +867,13 @@ public class AccountManagerImpl implements AccountManager, AccountService { for (IPAddressVO ip : ips) { List podVlanMaps = _podVlanMapDao.listPodVlanMapsByVlan(ip.getVlanDbId()); - Long podId = podVlanMaps.get(0).getPodId(); - if (podId != null) { - continue;//bug 5561 do not release direct attach pod ips until vm is destroyed + if (podVlanMaps != null && podVlanMaps.size() != 0) { + Long podId = podVlanMaps.get(0).getPodId(); + if (podId != null) { + continue;//bug 5561 do not release direct attach pod ips until vm is destroyed + } } + if (!_networkMgr.releasePublicIpAddress(User.UID_SYSTEM, ip.getAddress())) { s_logger.error("Unable to release IP: " + ip.getAddress()); accountCleanupNeeded = true;