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:
parent
406f005b4f
commit
593e9d9aef
@ -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}).";
|
||||||
|
Loading…
Reference in New Issue
Block a user