Check for null in FindPlayer to avoid errors on null object

This commit is contained in:
stevenh 2012-02-13 21:16:50 +00:00
parent fb11729547
commit c5497acae7

View file

@ -205,6 +205,9 @@ namespace TShockAPI
public List<TSPlayer> FindPlayer(string ply)
{
var found = new List<TSPlayer>();
// Avoid errors caused by null search
if (null == ply)
return found;
ply = ply.ToLower();
foreach (TSPlayer player in TShock.Players)
{