Skip to content

Commit

Permalink
fix: check existence before creating a new list from groups list
Browse files Browse the repository at this point in the history
  • Loading branch information
phiz71 authored and a-cordier committed Mar 1, 2022
1 parent 0b6e12a commit 998bd9c
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3843,11 +3843,8 @@ public Map<String, List<GroupMemberEntity>> getGroupsWithMembers(String environm
try {
Api api = apiRepository.findById(apiId).orElseThrow(() -> new ApiNotFoundException(apiId));

Set<MemberEntity> members = membershipService.getMembersByReferencesAndRole(
MembershipReferenceType.GROUP,
new ArrayList<>(api.getGroups()),
null
);
final List<String> apiGroups = api.getGroups() == null ? new ArrayList<>() : new ArrayList<>(api.getGroups());
Set<MemberEntity> members = membershipService.getMembersByReferencesAndRole(MembershipReferenceType.GROUP, apiGroups, null);

return members
.stream()
Expand Down

0 comments on commit 998bd9c

Please sign in to comment.