Fix edge case of importing exactly enough members to hit the cap

It's OK if import will bring us to the cap (1000), just don't let the count go beyond that.
This commit is contained in:
Noko 2019-10-20 18:24:00 -05:00
parent 406f005b4f
commit 593e9d9aef

View File

@ -121,7 +121,7 @@ namespace PluralKit.Bot
// If creating the unmatched members would put us over the member limit, abort before creating any members // If creating the unmatched members would put us over the member limit, abort before creating any members
// new total: # in the system + (# in the file - # in the file that already exist) // new total: # in the system + (# in the file - # in the file that already exist)
if (data.Members.Count - dataFileToMemberMapping.Count + existingMembers.Count() >= Limits.MaxMemberCount) if (data.Members.Count - dataFileToMemberMapping.Count + existingMembers.Count() > Limits.MaxMemberCount)
{ {
result.Success = false; result.Success = false;
result.Message = $"Import would exceed the maximum number of members ({Limits.MaxMemberCount})."; result.Message = $"Import would exceed the maximum number of members ({Limits.MaxMemberCount}).";