From 2cfff8579a1cb3ea275912516ebbfa7ba5c168f9 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sat, 20 Jul 2019 13:23:22 +0200 Subject: [PATCH] Fix wanted system null reference --- ReallifeGamemode.Server/Wanted/Jail.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReallifeGamemode.Server/Wanted/Jail.cs b/ReallifeGamemode.Server/Wanted/Jail.cs index 566f047e..8bff1474 100644 --- a/ReallifeGamemode.Server/Wanted/Jail.cs +++ b/ReallifeGamemode.Server/Wanted/Jail.cs @@ -137,7 +137,7 @@ namespace ReallifeGamemode.Server.Wanted { 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()) {