Merge pull request #11526 from AdmiralCurtiss/netplay-crash
ENetUtil: Add check for valid socket in SendPacket().
This commit is contained in:
commit
fbb3db71b2
|
@ -39,6 +39,12 @@ int ENET_CALLBACK InterceptCallback(ENetHost* host, ENetEvent* event)
|
|||
|
||||
bool SendPacket(ENetPeer* socket, const sf::Packet& packet, u8 channel_id)
|
||||
{
|
||||
if (!socket)
|
||||
{
|
||||
ERROR_LOG_FMT(NETPLAY, "Target socket is null.");
|
||||
return false;
|
||||
}
|
||||
|
||||
ENetPacket* epac =
|
||||
enet_packet_create(packet.getData(), packet.getDataSize(), ENET_PACKET_FLAG_RELIABLE);
|
||||
if (!epac)
|
||||
|
|
Loading…
Reference in New Issue