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)); }