Fix wanted system null reference

This commit is contained in:
hydrant
2019-07-20 13:23:22 +02:00
parent 9bd5b029cd
commit 2cfff8579a

View File

@@ -137,7 +137,7 @@ namespace ReallifeGamemode.Server.Wanted
{ {
User user = player.GetUser(); User user = player.GetUser();
if (player.Position.DistanceTo2D(new Vector3(458.9842, -997.2126, 24.91485)) > 7 && Jailtime.ContainsKey(user.Id)) if (user != null && player.Position.DistanceTo2D(new Vector3(458.9842, -997.2126, 24.91485)) > 7 && Jailtime.ContainsKey(user.Id))
{ {
using (var dbContext = new DatabaseContext()) using (var dbContext = new DatabaseContext())
{ {