Potential fix for concurrent list modification error
This commit is contained in:
parent
17826246f2
commit
e7f95c9ba6
@ -64,7 +64,7 @@ namespace PluralKit.Bot
|
|||||||
{
|
{
|
||||||
var roleIdCache = _roleIdsField.GetValue(member) as List<ulong>;
|
var roleIdCache = _roleIdsField.GetValue(member) as List<ulong>;
|
||||||
var currentRoleIds = member.Roles.Where(x => x != null).Select(x => x.Id);
|
var currentRoleIds = member.Roles.Where(x => x != null).Select(x => x.Id);
|
||||||
var invalidRoleIds = roleIdCache.Where(x => !currentRoleIds.Contains(x));
|
var invalidRoleIds = roleIdCache.Where(x => !currentRoleIds.Contains(x)).ToList();
|
||||||
roleIdCache.RemoveAll(x => invalidRoleIds.Contains(x));
|
roleIdCache.RemoveAll(x => invalidRoleIds.Contains(x));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user