From ca098d5cd4d9aa99ce4064380d60c581702d8d81 Mon Sep 17 00:00:00 2001 From: MaxDorob Date: Tue, 18 Jun 2024 20:43:50 +0600 Subject: [PATCH] NRE fix --- .../CombatExtended/Render/PawnRenderNodeWorker_Drafted.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CombatExtended/CombatExtended/Render/PawnRenderNodeWorker_Drafted.cs b/Source/CombatExtended/CombatExtended/Render/PawnRenderNodeWorker_Drafted.cs index 1094110676..d964a924c4 100644 --- a/Source/CombatExtended/CombatExtended/Render/PawnRenderNodeWorker_Drafted.cs +++ b/Source/CombatExtended/CombatExtended/Render/PawnRenderNodeWorker_Drafted.cs @@ -13,7 +13,7 @@ public class PawnRenderNodeWorker_Drafted : PawnRenderNodeWorker public override bool CanDrawNow(PawnRenderNode node, PawnDrawParms parms) { var pawn = node.tree.pawn; - return (pawn.Drafted || (pawn.CurJob?.def.alwaysShowWeapon ?? false) || (pawn.mindState.duty?.def.alwaysShowWeapon ?? false)) && base.CanDrawNow(node, parms); + return pawn != null && pawn.Spawned && (pawn.Drafted || (pawn.CurJob?.def.alwaysShowWeapon ?? false) || (pawn.mindState?.duty?.def.alwaysShowWeapon ?? false)) && base.CanDrawNow(node, parms); } } }