Browse Source

Fixed nullref during reconnect

pull/501/head
RogueException 8 years ago
parent
commit
a266d072db
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net.WebSocket/DiscordSocketClient.cs

+ 1
- 1
src/Discord.Net.WebSocket/DiscordSocketClient.cs View File

@@ -313,7 +313,7 @@ namespace Discord.WebSocket


private async Task StartReconnectAsync(Exception ex) private async Task StartReconnectAsync(Exception ex)
{ {
if ((ex as WebSocketClosedException).CloseCode == 4004) //Bad Token
if ((ex as WebSocketClosedException)?.CloseCode == 4004) //Bad Token
{ {
_canReconnect = false; _canReconnect = false;
_connectTask?.TrySetException(ex); _connectTask?.TrySetException(ex);


Loading…
Cancel
Save