From e7f95c9ba645d00f0ce30536468b5fded8f5a71b Mon Sep 17 00:00:00 2001 From: Ske Date: Tue, 14 Jul 2020 22:24:13 +0200 Subject: [PATCH] Potential fix for concurrent list modification error --- PluralKit.Bot/Utils/DiscordUtils.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PluralKit.Bot/Utils/DiscordUtils.cs b/PluralKit.Bot/Utils/DiscordUtils.cs index 0ef9a347..0c58976a 100644 --- a/PluralKit.Bot/Utils/DiscordUtils.cs +++ b/PluralKit.Bot/Utils/DiscordUtils.cs @@ -64,7 +64,7 @@ namespace PluralKit.Bot { var roleIdCache = _roleIdsField.GetValue(member) as List; 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)); }