mirror of https://github.com/apache/cloudstack.git
PublicNetworkGuru: fixed NPE in ipUnassign
This commit is contained in:
parent
27f2b6cbb1
commit
d5bded3d6d
|
|
@ -154,7 +154,9 @@ public class PublicNetworkGuru extends AdapterBase implements NetworkGuru {
|
|||
@Override
|
||||
public void deallocate(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm) {
|
||||
IPAddressVO ip = _ipAddressDao.findByAccountAndIp(vm.getVirtualMachine().getAccountId(), nic.getIp4Address());
|
||||
_ipAddressDao.unassignIpAddress(ip.getId());
|
||||
if (ip != null) {
|
||||
_ipAddressDao.unassignIpAddress(ip.getId());
|
||||
}
|
||||
nic.deallocate();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue