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