diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index bfa79a29dc2..9cef4424a5c 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -3251,11 +3251,11 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati if ((accountName != null) && (domainId != null)) { vlanOwner = _accountDao.findActiveAccount(accountName, domainId); - if (vlanOwner == null) { - throw new InvalidParameterValueException("Unable to find account by name " + accountName); - } else if (vlanOwner.getId() == Account.ACCOUNT_ID_SYSTEM) { - throw new InvalidParameterValueException("Please specify a valid account. Cannot dedicate IP range to system account"); - } + } + if (vlanOwner == null) { + throw new InvalidParameterValueException("Unable to find account by name " + accountName); + } else if (vlanOwner.getId() == Account.ACCOUNT_ID_SYSTEM) { + throw new InvalidParameterValueException("Please specify a valid account. Cannot dedicate IP range to system account"); } // Check if range is valid diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java index 5e231e9ddcc..e161e3f49f3 100755 --- a/server/src/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/com/cloud/network/NetworkServiceImpl.java @@ -3014,9 +3014,9 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { if ((accountName != null) && (domainId != null)) { vlanOwner = _accountDao.findActiveAccount(accountName, domainId); - if (vlanOwner == null) { - throw new InvalidParameterValueException("Unable to find account by name " + accountName); - } + } + if (vlanOwner == null) { + throw new InvalidParameterValueException("Unable to find account by name " + accountName); } vlanOwnerId = vlanOwner.getAccountId();