Skip to content

Commit

Permalink
Fix nullref when passing null to GetShardIdFor. (#1049)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntiTcb authored and foxbot committed May 4, 2018
1 parent e775853 commit 7cfed7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Discord.Net.WebSocket/DiscordShardedClient.cs
Expand Up @@ -129,7 +129,7 @@ public DiscordSocketClient GetShard(int id)
private int GetShardIdFor(ulong guildId)
=> (int)((guildId >> 22) % (uint)_totalShards);
public int GetShardIdFor(IGuild guild)
=> GetShardIdFor(guild.Id);
=> GetShardIdFor(guild?.Id ?? 0);
private DiscordSocketClient GetShardFor(ulong guildId)
=> GetShard(GetShardIdFor(guildId));
public DiscordSocketClient GetShardFor(IGuild guild)
Expand Down

0 comments on commit 7cfed7f

Please sign in to comment.