Browse Source

fix: nullcheck _shards before iterating (#1493)

pull/1595/head
Min Paulo 5 years ago
parent
commit
4fbb481b7e
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

@@ -389,8 +389,11 @@ namespace Discord.WebSocket
{
if (disposing)
{
foreach (var client in _shards)
client?.Dispose();
if (_shards != null)
{
foreach (var client in _shards)
client?.Dispose();
}
_connectionGroupLock?.Dispose();
}



Loading…
Cancel
Save