Skip to content

Commit

Permalink
Avoid nullpointer when manage is not behaving
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Jan 9, 2024
1 parent 367e7de commit b99121a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 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 provider;
return Collections.emptyMap();
}
Map data = (Map) provider.get("data");
//When mocking - using the results of LocalManage - the provider may already be transformed
if (CollectionUtils.isEmpty(data)) {
return provider;
return Collections.emptyMap();
}
Map metaDataFields = (Map) data.get("metaDataFields");
//Can't use Map.of as values can be null
Expand Down

0 comments on commit b99121a

Please sign in to comment.