Skip to content

Commit

Permalink
ENetUtil: Add check for valid socket in SendPacket().
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiralCurtiss committed Feb 1, 2023
1 parent 2a2ee5d commit 52365b2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/Core/Common/ENetUtil.cpp
Expand Up @@ -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, "No socket to send to given.");
return false;
}

ENetPacket* epac =
enet_packet_create(packet.getData(), packet.getDataSize(), ENET_PACKET_FLAG_RELIABLE);
if (!epac)
Expand Down

0 comments on commit 52365b2

Please sign in to comment.