From 80156d29c42cff18c5c9fb4389458035457c4a3a Mon Sep 17 00:00:00 2001 From: nxrighthere Date: Wed, 22 Aug 2018 08:42:24 +0500 Subject: [PATCH] Add check before sending a packet --- Source/Managed/ENet.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Managed/ENet.cs b/Source/Managed/ENet.cs index eb90232..5ad1c0f 100644 --- a/Source/Managed/ENet.cs +++ b/Source/Managed/ENet.cs @@ -576,6 +576,8 @@ public void ConfigureThrottle(uint interval, uint acceleration, uint deceleratio } public bool Send(byte channelID, Packet packet) { + CheckCreated(); + return Native.enet_peer_send(nativePeer, channelID, packet.NativeData) >= 0; }