Check for null in FindPlayer to avoid errors on null object
This commit is contained in:
parent
fb11729547
commit
c5497acae7
1 changed files with 3 additions and 0 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue