fix: nullcheck _shards before iterating (#1493)

This commit is contained in:
Min
2020-04-22 16:02:22 +10:00
committed by GitHub
parent c637bab91a
commit 1f01a2d1fa

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();
}