Guard against pathological remote-config value for banned members
This commit is contained in:
parent
1927cf65db
commit
e8c925082e
@ -481,7 +481,7 @@ public class GroupsV2OutgoingChanges {
|
||||
// least-recently banned.
|
||||
let maxNumBannableIds = RemoteConfig.current.maxGroupSizeBannedMembers
|
||||
let netNumIdsToBan = acisToBan.count - acisToUnban.count
|
||||
let nOldMembersToUnban = currentBannedMembers.count + netNumIdsToBan - Int(maxNumBannableIds)
|
||||
let nOldMembersToUnban = currentBannedMembers.count + netNumIdsToBan - Int(clamping: maxNumBannableIds)
|
||||
|
||||
if nOldMembersToUnban > 0 {
|
||||
let bannedSortedByAge = currentBannedMembers.sorted { member1, member2 -> Bool in
|
||||
|
||||
Loading…
Reference in New Issue
Block a user