Fixed nullref during reconnect

This commit is contained in:
RogueException
2017-01-28 19:04:42 -04:00
parent 547d7d241f
commit a266d072db

View File

@@ -313,7 +313,7 @@ namespace Discord.WebSocket
private async Task StartReconnectAsync(Exception ex)
{
if ((ex as WebSocketClosedException).CloseCode == 4004) //Bad Token
if ((ex as WebSocketClosedException)?.CloseCode == 4004) //Bad Token
{
_canReconnect = false;
_connectTask?.TrySetException(ex);