adds a null check to Receive()

This commit is contained in:
Neil Dorin
2019-12-12 15:32:58 -07:00
parent f3b70a8edb
commit b96ac89195

View File

@@ -335,6 +335,8 @@ namespace PepperDash.Core
/// <param name="client"></param> /// <param name="client"></param>
/// <param name="numBytes"></param> /// <param name="numBytes"></param>
void Receive(TCPClient client, int numBytes) void Receive(TCPClient client, int numBytes)
{
if (client != null)
{ {
if (numBytes > 0) if (numBytes > 0)
{ {
@@ -349,7 +351,9 @@ namespace PepperDash.Core
textHandler(this, new GenericCommMethodReceiveTextArgs(str)); textHandler(this, new GenericCommMethodReceiveTextArgs(str));
} }
} }
Client.ReceiveDataAsync(Receive);
client.ReceiveDataAsync(Receive);
}
} }
/// <summary> /// <summary>