fix CLOUDSTACK-2061 Hitting java NPE in addNicToVirtualMachine api when trying to add a shared network to a VM

This commit is contained in:
Mice Xia 2013-04-18 14:56:44 +08:00
parent 985b2aa88d
commit dfbe11355c

View File

@ -876,8 +876,8 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
if (publicNetwork) {
routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
} else {
Long podId = dest.getPod().getId();
if (isPodBased) {
Long podId = dest.getPod().getId();
routers = _routerDao.listByNetworkAndPodAndRole(network.getId(), podId, Role.VIRTUAL_ROUTER);
} else {
routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);