diff --git a/server/src/main/java/access/manage/Manage.java b/server/src/main/java/access/manage/Manage.java index 9b24773b..d73342a2 100644 --- a/server/src/main/java/access/manage/Manage.java +++ b/server/src/main/java/access/manage/Manage.java @@ -33,12 +33,12 @@ default List> transformProvider(List> pr default Map transformProvider(Map 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 @@ -102,6 +102,10 @@ default List addManageMetaData(List roles) { role.getApplicationUsages().stream() .map(applicationUsage -> { Map 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; })