Skip to content

Commit

Permalink
Reverted bad commit
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Jan 9, 2024
1 parent b99121a commit 96b401f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/src/main/java/access/manage/Manage.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ default List<Map<String, Object>> transformProvider(List<Map<String, Object>> pr
default Map<String, Object> transformProvider(Map<String, Object> provider) {
//Defensive mostly because of tests
if (CollectionUtils.isEmpty(provider)) {
return Collections.emptyMap();
return provider;
}
Map data = (Map) provider.get("data");
//When mocking - using the results of LocalManage - the provider may already be transformed
if (CollectionUtils.isEmpty(data)) {
return Collections.emptyMap();
return provider;
}
Map metaDataFields = (Map) data.get("metaDataFields");
//Can't use Map.of as values can be null
Expand Down Expand Up @@ -102,6 +102,10 @@ default List<Role> addManageMetaData(List<Role> roles) {
role.getApplicationUsages().stream()
.map(applicationUsage -> {
Map<String, Object> applicationMap = transformProvider(remoteApplications.get(applicationUsage.getApplication().getManageId()));
if (applicationMap == null) {
//If remote manage is not behaving
applicationMap = new HashMap<>();
}
applicationMap.put("landingPage", applicationUsage.getLandingPage());
return applicationMap;
})
Expand Down

0 comments on commit 96b401f

Please sign in to comment.