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

This commit is contained in:
RogueException
2016-02-11 17:54:21 -04:00
parent 903b6a352b
commit c4b7f78d45

View File

@@ -315,7 +315,9 @@ namespace Discord
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