1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-16 15:16:33 +09:00

Avoid throwing exception in SendToAll when no connections

This commit is contained in:
lidgren
2011-12-09 09:16:10 +00:00
parent cef6a3adf6
commit 3336e95586

View File

@@ -24,7 +24,11 @@ namespace Lidgren.Network
/// <param name="method">How to deliver the message</param>
public void SendToAll(NetOutgoingMessage msg, NetDeliveryMethod method)
{
SendMessage(msg, this.Connections, method, 0);
var all = this.Connections;
if (all.Count <= 0)
return;
SendMessage(msg, all, method, 0);
}
/// <summary>