Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle null PreferredLocale in rare cases where Discord messes up #1624

Merged
merged 1 commit into from
Oct 14, 2020
Merged

Handle null PreferredLocale in rare cases where Discord messes up #1624

merged 1 commit into from
Oct 14, 2020

Conversation

hollowstrawberry
Copy link
Contributor

@hollowstrawberry hollowstrawberry commented Sep 6, 2020

Sometimes Discord messes up and leaves a guild with a null PreferredLocale, causing an error to be thrown. This fixes that from Discord.Net's end even though it's Discord's fault.

I made this this PR because I had been getting an error for a single guild every time my bot starts up.

Gateway6> Error handling Dispatch (GUILD_AVAILABLE): System.ArgumentNullException: Value cannot be null. (Parameter 'name')
   at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride)
   at Discord.WebSocket.SocketGuild.Update(ClientState state, Guild model)
   at Discord.WebSocket.SocketGuild.Update(ClientState state, ExtendedGuild model)
   at Discord.WebSocket.DiscordSocketClient.ProcessMessageAsync(GatewayOpCode opCode, Nullable`1 seq, String type, Object payload)

Sometimes Discord messes up and leaves a guild with a null PreferredLocale, causing an error to be thrown. This fixes that from Discord.Net's end even though it's Discord's fault.
@hollowstrawberry
Copy link
Contributor Author

hollowstrawberry commented Sep 6, 2020

Actually I found the guild, I guess I'll make a report to the discord api

ID is 297408095137562625
image

@foxbot foxbot merged commit c1d04b4 into discord-net:dev Oct 14, 2020
anonymousheadless pushed a commit to anonymousheadless/Discord.Net that referenced this pull request Mar 29, 2021
Sometimes Discord messes up and leaves a guild with a null PreferredLocale, causing an error to be thrown. This fixes that from Discord.Net's end even though it's Discord's fault.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants