Browse Source

Don't nullref in ShardedClient's OnLogout if already logged out.

tags/1.0-rc
RogueException 8 years ago
parent
commit
004bb4cae0
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      src/Discord.Net.WebSocket/DiscordShardedClient.cs

+ 5
- 2
src/Discord.Net.WebSocket/DiscordShardedClient.cs View File

@@ -98,8 +98,11 @@ namespace Discord.WebSocket
internal override async Task OnLogoutAsync()
{
//Assume threadsafe: already in a connection lock
for (int i = 0; i < _shards.Length; i++)
await _shards[i].LogoutAsync();
if (_shards != null)
{
for (int i = 0; i < _shards.Length; i++)
await _shards[i].LogoutAsync();
}

CurrentUser = null;
if (_automaticShards)


Loading…
Cancel
Save