mirror of https://github.com/apache/cloudstack.git
Bug 12993 - NullPointer Exception thrown when listRouters() is called.
Changes: - Adding null checks.
This commit is contained in:
parent
871777b45e
commit
aa3e8a05be
|
|
@ -3904,9 +3904,9 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
|||
boolean isDomRGuestOrPublicNetwork = false;
|
||||
if (vm != null) {
|
||||
Nic nic = _nicDao.findByInstanceIdAndNetworkId(networkId, vmId);
|
||||
if (vm.getType() == Type.User && nic.isDefaultNic()) {
|
||||
if (vm.getType() == Type.User && nic != null && nic.isDefaultNic()) {
|
||||
isUserVmsDefaultNetwork = true;
|
||||
} else if (vm.getType() == Type.DomainRouter && (ntwkOff.getTrafficType() == TrafficType.Public || ntwkOff.getTrafficType() == TrafficType.Guest)) {
|
||||
} else if (vm.getType() == Type.DomainRouter && ntwkOff != null && (ntwkOff.getTrafficType() == TrafficType.Public || ntwkOff.getTrafficType() == TrafficType.Guest)) {
|
||||
isDomRGuestOrPublicNetwork = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue