Fixes null exception thrown on /save

TShock.Players was not being checked for null objects.

Reported by InanZen.
This commit is contained in:
Deathmax 2012-05-27 21:05:28 +08:00
parent 2b0549f04c
commit ed0756e80c

View file

@ -2173,7 +2173,7 @@ namespace TShockAPI
private static void Save(CommandArgs args)
{
SaveManager.Instance.SaveWorld(false);
foreach (TSPlayer tsply in TShock.Players)
foreach (TSPlayer tsply in TShock.Players.Where(tsply => tsply != null))
{
tsply.SaveServerInventory();
}