From b5f68df826e0f1bb5cb50133bef13345ba8c30b7 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Mon, 17 Jul 2023 17:08:37 +0200 Subject: [PATCH] Fix rare crasher due to missing NULL check on netchan Netchan could be NULL, add a check in. --- r5dev/engine/client/client.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/r5dev/engine/client/client.cpp b/r5dev/engine/client/client.cpp index 0101c3ca..44c81f66 100644 --- a/r5dev/engine/client/client.cpp +++ b/r5dev/engine/client/client.cpp @@ -121,10 +121,10 @@ void CClient::VActivatePlayer(CClient* pClient) pClient->SetPersistenceState(PERSISTENCE::PERSISTENCE_READY); v_CClient_ActivatePlayer(pClient); - if (sv_showconnecting->GetBool()) - { - const CNetChan* pNetChan = pClient->GetNetChan(); + const CNetChan* pNetChan = pClient->GetNetChan(); + if (pNetChan && sv_showconnecting->GetBool()) + { DevMsg(eDLL_T::SERVER, "Activated player #%d; channel %s(%s) ('%llu')\n", pClient->GetUserID(), pNetChan->GetName(), pNetChan->GetAddress(), pClient->GetNucleusID()); }