added check on organization existence

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@141886 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2017-01-28 15:51:28 +00:00
parent 7080f55c9e
commit 911a1b976f
2 changed files with 3 additions and 1 deletions

View File

@ -33,5 +33,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry kind="output" path="target/gcube-ckan-datacatalog-1.2.0-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -41,7 +41,8 @@ public class AddUserToOrganizationThread extends Thread {
Set<Entry<String, String>> entrySet = orgAndCapacity.entrySet();
for (Entry<String, String> entry : entrySet) {
instance.checkRoleIntoOrganization(username, entry.getKey(), RolesCkanGroupOrOrg.convertFromCapacity(entry.getValue()));
if(instance.getOrganizationByName(entry.getKey()) != null)
instance.checkRoleIntoOrganization(username, entry.getKey(), RolesCkanGroupOrOrg.convertFromCapacity(entry.getValue()));
}
logger.debug("Thread for role association ended");