From 89ce8bd9e289327f411790eb05a9fb49ef1f9a2f Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Wed, 4 Nov 2015 09:57:44 +0100 Subject: [PATCH] CLOUDSTACK-8958: throw an exception if project account cannot be found --- .../com/cloud/configuration/ConfigurationManagerImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 4ecec3bd807..40fd2568400 100644 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -2618,6 +2618,9 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati } vlanOwner = _accountMgr.getAccount(project.getProjectAccountId()); + if (vlanOwner == null) { + throw new InvalidParameterValueException("Please specify a valid projectId"); + } } Domain domain = null; @@ -3329,6 +3332,9 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati throw new InvalidParameterValueException("Unable to find project by id " + projectId); } vlanOwner = _accountMgr.getAccount(project.getProjectAccountId()); + if (vlanOwner == null) { + throw new InvalidParameterValueException("Please specify a valid projectId"); + } } Domain domain = null;