Browse Source

Dont nullref if SetStatus/SetGame are called during a disconnected state

tags/docs-0.9
RogueException 9 years ago
parent
commit
c4b7f78d45
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/Discord.Net/DiscordClient.cs

+ 3
- 1
src/Discord.Net/DiscordClient.cs View File

@@ -315,7 +315,9 @@ namespace Discord
current.CurrentGame = CurrentGame; current.CurrentGame = CurrentGame;
} }
} }
GatewaySocket.SendUpdateStatus(Status == UserStatus.Idle ? EpochTime.GetMilliseconds() - (10 * 60 * 1000) : (long?)null, CurrentGame);
var socket = GatewaySocket;
if (socket != null)
socket.SendUpdateStatus(Status == UserStatus.Idle ? EpochTime.GetMilliseconds() - (10 * 60 * 1000) : (long?)null, CurrentGame);
} }


#region Channels #region Channels


Loading…
Cancel
Save