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) if (disposing)
{ {
foreach (var client in _shards) if (_shards != null)
client?.Dispose(); {
foreach (var client in _shards)
client?.Dispose();
}
_connectionGroupLock?.Dispose(); _connectionGroupLock?.Dispose();
} }