Fixed NPE when user not belongs to any context

This commit is contained in:
Mauro Mugnaini 2020-05-29 15:47:51 +02:00
parent 8989c927c0
commit 9d58dd475e
1 changed files with 4 additions and 4 deletions

View File

@ -86,8 +86,8 @@ public class UserSitesToGroupsAndRolesMapper {
Site gwSitesTree = null; Site gwSitesTree = null;
try { try {
gwSitesTree = mapper.map(rootVOGCubeGroup.getGroupName()); gwSitesTree = mapper.map(rootVOGCubeGroup.getGroupName());
if (log.isInfoEnabled()) { if (log.isDebugEnabled()) {
log.info("Sites tree is: " + gwSitesTree.dump()); log.debug("Sites tree is: " + (gwSitesTree != null ? gwSitesTree.dump() : "null"));
} }
} catch (SitesMapperExecption e) { } catch (SitesMapperExecption e) {
log.error("Computing sites tree in concrete mapper class", e); log.error("Computing sites tree in concrete mapper class", e);
@ -101,7 +101,7 @@ public class UserSitesToGroupsAndRolesMapper {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Check user to sites removal"); log.debug("Check user to sites removal");
} }
checkForVRERemoval(gwSitesTree); checkForSiteRemoval(gwSitesTree);
} }
@ -205,7 +205,7 @@ public class UserSitesToGroupsAndRolesMapper {
} }
} }
protected void checkForVRERemoval(Site gwSitesTree) { protected void checkForSiteRemoval(Site gwSitesTree) {
List<String> vreNames = new ArrayList<>(); List<String> vreNames = new ArrayList<>();
if (gwSitesTree != null) { if (gwSitesTree != null) {
log.debug("Collecting VREs user belongs to"); log.debug("Collecting VREs user belongs to");