diff --git a/mod/Jailbreak.Teams/Queue/QueueBehavior.cs b/mod/Jailbreak.Teams/Queue/QueueBehavior.cs index dbf2f722..3bf72a50 100644 --- a/mod/Jailbreak.Teams/Queue/QueueBehavior.cs +++ b/mod/Jailbreak.Teams/Queue/QueueBehavior.cs @@ -135,7 +135,7 @@ public void ForceGuard(CCSPlayerController player) /// public HookResult OnRequestToJoinTeam(CCSPlayerController? invoked, CommandInfo command) { - if (invoked == null) + if (invoked == null || !invoked.IsValid) return HookResult.Continue; var state = _state.Get(invoked); @@ -173,8 +173,11 @@ public HookResult OnRequestToJoinTeam(CCSPlayerController? invoked, CommandInfo [GameEventHandler] public HookResult OnPlayerSpawn(EventPlayerSpawn ev, GameEventInfo info) { - var state = _state.Get(ev.Userid); var player = ev.Userid; + if (!player.IsValid) + return HookResult.Continue; + + var state = _state.Get(ev.Userid); if (player.GetTeam() == CsTeam.CounterTerrorist && !state.IsGuard) {