summaryrefslogtreecommitdiff
path: root/Source/Core/Common/ENetUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/ENetUtil.cpp')
-rw-r--r--Source/Core/Common/ENetUtil.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/Common/ENetUtil.cpp b/Source/Core/Common/ENetUtil.cpp
index d06de7c82a..3cdfbf8829 100644
--- a/Source/Core/Common/ENetUtil.cpp
+++ b/Source/Core/Common/ENetUtil.cpp
@@ -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)