mirror of
https://git.suyu.dev/suyu/discord-rpc.git
synced 2026-03-20 16:48:45 +00:00
Add a few more null checks.
This commit is contained in:
@@ -95,6 +95,10 @@ static void SendQueueCommitMessage()
|
||||
|
||||
extern "C" void Discord_UpdateConnection()
|
||||
{
|
||||
if (!Connection) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Connection->IsOpen()) {
|
||||
if (std::chrono::system_clock::now() >= NextConnect) {
|
||||
UpdateReconnectTime();
|
||||
@@ -292,6 +296,10 @@ extern "C" void Discord_RunCallbacks()
|
||||
// of times inbetween calls here. Externally, we want the sequence to seem sane, so any other
|
||||
// signals are book-ended by calls to ready and disconnect.
|
||||
|
||||
if (!Connection) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool wasDisconnected = WasJustDisconnected.exchange(false);
|
||||
bool isConnected = Connection->IsOpen();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user