mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
MT - fix NPE (check tenant exists)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8311 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -457,6 +457,11 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
||||
|
||||
public void enableTenant(String tenantDomain)
|
||||
{
|
||||
if (! existsTenant(tenantDomain))
|
||||
{
|
||||
throw new RuntimeException("Tenant does not exist: " + tenantDomain);
|
||||
}
|
||||
|
||||
if (isEnabledTenant(tenantDomain))
|
||||
{
|
||||
logger.warn("Tenant already enabled: " + tenantDomain);
|
||||
@@ -495,6 +500,11 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
||||
|
||||
public void disableTenant(String tenantDomain)
|
||||
{
|
||||
if (! existsTenant(tenantDomain))
|
||||
{
|
||||
throw new RuntimeException("Tenant does not exist: " + tenantDomain);
|
||||
}
|
||||
|
||||
if (! isEnabledTenant(tenantDomain))
|
||||
{
|
||||
logger.warn("Tenant already disabled: " + tenantDomain);
|
||||
@@ -566,6 +576,11 @@ public class MultiTAdminServiceImpl extends AbstractLifecycleBean implements Ten
|
||||
|
||||
public Tenant getTenant(String tenantDomain)
|
||||
{
|
||||
if (! existsTenant(tenantDomain))
|
||||
{
|
||||
throw new RuntimeException("Tenant does not exist: " + tenantDomain);
|
||||
}
|
||||
|
||||
return new Tenant(tenantDomain, isEnabledTenant(tenantDomain), getRootContentStoreDir(tenantDomain));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user