diff --git a/TShockAPI/Properties/AssemblyInfo.cs b/TShockAPI/Properties/AssemblyInfo.cs index 37351868..9bbabf72 100644 --- a/TShockAPI/Properties/AssemblyInfo.cs +++ b/TShockAPI/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.3.0.0625")] -[assembly: AssemblyFileVersion("2.3.0.0625")] \ No newline at end of file +[assembly: AssemblyVersion("2.3.0.0627")] +[assembly: AssemblyFileVersion("2.3.0.0627")] \ No newline at end of file diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 560b4b84..c666df6d 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -220,11 +220,12 @@ namespace TShockAPI if (!player.Group.HasPermission("usebanneditem")) { - for (int i = 0; i < Main.player[player.Index].inventory.Length; i++) + var inv = Main.player[player.Index].inventory; + for (int i = 0; i < inv.Length; i++) { - if (ItemManager.ItemIsBanned(Main.player[player.Index].inventory[i].name)) + if (inv[i] != null && ItemManager.ItemIsBanned(inv[i].name)) { - player.Disconnect("Using banned item: " + Main.player[player.Index].inventory[i].name + ", remove it and rejoin"); + player.Disconnect("Using banned item: " + inv[i].name + ", remove it and rejoin"); break; } }