Skip to content

Commit 404b288

Browse files
committed
Throw an exception when can't find network offering during zone creation
1 parent f84c81a commit 404b288

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎server/src/com/cloud/network/NetworkManagerImpl.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2348,7 +2348,7 @@ public NetworkVO getSystemNetworkByZoneAndTrafficType(long zoneId, TrafficType t
23482348
}
23492349

23502350
List<NetworkVO> networks = _networksDao.listBy(Account.ACCOUNT_ID_SYSTEM, networkOfferingId, zoneId);
2351-
if (networks == null) {
2351+
if (networks == null || networks.isEmpty()) {
23522352
throw new InvalidParameterValueException("Unable to find network with traffic type " + trafficType + " in zone " + zoneId);
23532353
}
23542354
return networks.get(0);

0 commit comments

Comments
 (0)