Skip to content

Commit

Permalink
🐛 empty team member lists
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient committed Jul 22, 2024
1 parent b0e04e8 commit c7bb8b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ public DataLabel createLabel(String labelName, String color) {

public boolean isTeamMember(GHUser user, String teamFullName) {
Set<GHUser> members = teamMembers(teamFullName);
Log.debugf("%s members: %s", teamFullName, members.stream().map(GHUser::getLogin).toList());
Log.debugf("%s members: %s", teamFullName, members == null ? "[]" : members.stream().map(GHUser::getLogin).toList());
return members != null && members.contains(user);
}

Expand Down Expand Up @@ -721,7 +721,7 @@ public Set<GHUser> teamMembers(String teamFullName) {
if (members == null) {
members = execGitHubSync((gh, dryRun) -> {
GHTeam ghTeam = org.getTeamByName(relativeName);
return ghTeam == null ? Set.of() : ghTeam.getMembers();
return ghTeam == null ? null : ghTeam.getMembers();
});
if (hasErrors() || members == null) {
clearNotFound();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public TeamList(String name, Set<DataActor> members) {
}

public TeamList removeExcludedMembers(Predicate<DataActor> predicate) {
members.removeIf(predicate::test);
if (!members.isEmpty()) {
members.removeIf(predicate::test);
}
return this;
}

Expand Down

0 comments on commit c7bb8b8

Please sign in to comment.