Wrap usages of TShock.Players[] with checks for out of bounds.
This commit is contained in:
parent
cd13cc97aa
commit
229d2bf990
2 changed files with 12 additions and 3 deletions
|
|
@ -258,7 +258,7 @@ namespace TShockAPI
|
|||
return found;
|
||||
|
||||
byte plrID;
|
||||
if (byte.TryParse(plr, out plrID))
|
||||
if (byte.TryParse(plr, out plrID) && plrID < Main.maxPlayers)
|
||||
{
|
||||
TSPlayer player = TShock.Players[plrID];
|
||||
if (player != null && player.Active)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue