Ensure IPs are > 0 otherwise the Linq will fail.

This commit is contained in:
DogooFalchion 2016-10-23 18:16:10 -04:00
parent 8f7b8db2a1
commit 701cfa0591

View file

@ -412,6 +412,8 @@ namespace TShockAPI
KnownIps = JsonConvert.DeserializeObject<List<String>>(args.Player.User.KnownIps);
}
if (KnownIps.Count > 0)
{
bool last = KnownIps.Last() == args.Player.IP;
if (!last)
{
@ -422,7 +424,7 @@ namespace TShockAPI
KnownIps.Add(args.Player.IP);
}
}
args.Player.User.KnownIps = JsonConvert.SerializeObject(KnownIps, Formatting.Indented);
Users.UpdateLogin(args.Player.User);
}