Don't nullref in ShardedClient's OnLogout if already logged out.
This commit is contained in:
@@ -98,8 +98,11 @@ namespace Discord.WebSocket
|
|||||||
internal override async Task OnLogoutAsync()
|
internal override async Task OnLogoutAsync()
|
||||||
{
|
{
|
||||||
//Assume threadsafe: already in a connection lock
|
//Assume threadsafe: already in a connection lock
|
||||||
for (int i = 0; i < _shards.Length; i++)
|
if (_shards != null)
|
||||||
await _shards[i].LogoutAsync();
|
{
|
||||||
|
for (int i = 0; i < _shards.Length; i++)
|
||||||
|
await _shards[i].LogoutAsync();
|
||||||
|
}
|
||||||
|
|
||||||
CurrentUser = null;
|
CurrentUser = null;
|
||||||
if (_automaticShards)
|
if (_automaticShards)
|
||||||
|
|||||||
Reference in New Issue
Block a user