Skip to content

Commit

Permalink
Merge branch 'group-with-null-members-apply-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
rickardliljeberg committed Jul 7, 2021
2 parents 9ea0e7c + 89b8723 commit 34b4b0f
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ private static void Apply(this Core2Group group, PatchOperation2 operation)
IList<Member> buffer = new List<Member>();
foreach (Member member in membersToAdd)
{
if(group.Members == null)
{
group.Members = Enumerable.Empty<Member>();
}

//O(n) with the number of group members, so for large groups this is not optimal
if (!group.Members.Any((Member item) =>
string.Equals(item.Value, member.Value, StringComparison.OrdinalIgnoreCase)))
Expand Down

0 comments on commit 34b4b0f

Please sign in to comment.