Add missing null pointer check to protobuf messages (#1883)

This commit is contained in:
zer0.k
2022-12-20 21:50:57 +00:00
committed by GitHub
parent b77e8c50ac
commit ef7d3abefd
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -505,6 +505,10 @@ void CRadioMenuPlayer::Radio_Refresh()
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
// TODO: find what happens past 240 on CS:GO
CCSUsrMsg_ShowMenu *msg = (CCSUsrMsg_ShowMenu *)g_UserMsgs.StartProtobufMessage(g_ShowMenuId, players, 1, USERMSG_BLOCKHOOKS);
if (!msg)
{
return;
}
msg->set_bits_valid_slots(display_keys);
msg->set_display_time(time);
msg->set_menu_string(ptr);
+4
View File
@@ -325,6 +325,10 @@ void UTIL_SendHudText(int client, const hud_text_parms &textparms, const char *p
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE || SOURCE_ENGINE == SE_MCV
CCSUsrMsg_HudMsg *msg = (CCSUsrMsg_HudMsg *)g_UserMsgs.StartProtobufMessage(g_HudMsgNum, players, 1, 0);
if (!msg)
{
return;
}
msg->set_channel(textparms.channel & 0xFF);
CMsgVector2D *pos = msg->mutable_pos();