evtl fix error bei tot

This commit is contained in:
hydrant
2020-05-10 12:14:22 +02:00
parent 521bcf850f
commit 53cc7f5176

View File

@@ -126,6 +126,11 @@ namespace ReallifeGamemode.Server.Extensions
foreach (var copPlayer in NAPI.Pools.GetAllPlayers()) foreach (var copPlayer in NAPI.Pools.GetAllPlayers())
{ {
if (copPlayer == null)
{
continue;
}
User copUser = copPlayer.GetUser(); User copUser = copPlayer.GetUser();
if (cop != null && (copUser.FactionId == 1 || copUser.FactionId == 3)) if (cop != null && (copUser.FactionId == 1 || copUser.FactionId == 3))
{ {
@@ -140,6 +145,7 @@ namespace ReallifeGamemode.Server.Extensions
} }
} }
} }
public static FactionRank GetFactionRank(this User user) public static FactionRank GetFactionRank(this User user)
{ {
using (var dbContext = new DatabaseContext()) using (var dbContext = new DatabaseContext())