mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-07 02:18:35 +00:00
Add missing null pointer check to protobuf messages (#1883)
(cherry picked from commit ef7d3abefd)
This commit is contained in:
parent
01fa02826f
commit
7eddae977a
@ -503,6 +503,10 @@ void CRadioMenuPlayer::Radio_Refresh()
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
|
||||
// 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);
|
||||
|
||||
@ -320,6 +320,10 @@ void UTIL_SendHudText(int client, const hud_text_parms &textparms, const char *p
|
||||
|
||||
#if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_BLADE
|
||||
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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user