Throw an exception when can't find network offering during zone creation

This commit is contained in:
alena 2011-03-22 13:49:54 -07:00
parent f84c81a47d
commit 404b288af4
1 changed files with 1 additions and 1 deletions

View File

@ -2348,7 +2348,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
}
List<NetworkVO> networks = _networksDao.listBy(Account.ACCOUNT_ID_SYSTEM, networkOfferingId, zoneId);
if (networks == null) {
if (networks == null || networks.isEmpty()) {
throw new InvalidParameterValueException("Unable to find network with traffic type " + trafficType + " in zone " + zoneId);
}
return networks.get(0);