mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-14 09:40:10 +00:00
Potential fix for concurrent list modification error
This commit is contained in:
parent
17826246f2
commit
e7f95c9ba6
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue