fix: Possible NullReferenceException when receiving InvalidSession (#1695)
This commit is contained in:
@@ -534,6 +534,8 @@ namespace Discord.WebSocket
|
||||
_sessionId = null;
|
||||
_lastSeq = 0;
|
||||
|
||||
if (_shardedClient != null)
|
||||
{
|
||||
await _shardedClient.AcquireIdentifyLockAsync(ShardId, _connection.CancelToken).ConfigureAwait(false);
|
||||
try
|
||||
{
|
||||
@@ -544,6 +546,9 @@ namespace Discord.WebSocket
|
||||
_shardedClient.ReleaseIdentifyLock();
|
||||
}
|
||||
}
|
||||
else
|
||||
await ApiClient.SendIdentifyAsync(shardID: ShardId, totalShards: TotalShards, guildSubscriptions: _guildSubscriptions, gatewayIntents: _gatewayIntents, presence: BuildCurrentStatus()).ConfigureAwait(false);
|
||||
}
|
||||
break;
|
||||
case GatewayOpCode.Reconnect:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user