Skip to content

Commit

Permalink
fix: checking if disconnected before packing message
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Frowen committed Jun 23, 2021
1 parent 2b8b38c commit a76caf1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Assets/Mirage/Runtime/NetworkPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ public void ClearHandlers()
/// <returns></returns>
public void Send<T>(T message, int channelId = Channel.Reliable)
{
if (isDisconnected) { return; }

using (PooledNetworkWriter writer = NetworkWriterPool.GetWriter())
{
// pack message and send allocation free
Expand Down

0 comments on commit a76caf1

Please sign in to comment.