From 3f5f6aa5d69f170ce04a430306d2f3a8be6be024 Mon Sep 17 00:00:00 2001 From: ryan-rsm-mckenzie Date: Tue, 22 Aug 2023 13:36:16 -0700 Subject: [PATCH] patch a null reference exception --- Source/Rule56/Comps/ThingComp_CombatAI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Rule56/Comps/ThingComp_CombatAI.cs b/Source/Rule56/Comps/ThingComp_CombatAI.cs index 37e2160..0cc66a1 100644 --- a/Source/Rule56/Comps/ThingComp_CombatAI.cs +++ b/Source/Rule56/Comps/ThingComp_CombatAI.cs @@ -693,7 +693,7 @@ void UpdateNearestEnemyMelee(Thing enemy) UpdateNearestEnemy(info.thing); } } - if (enemyPawn != null && enemyPawn.CurrentEffectiveVerb.IsMeleeAttack) + if (enemyPawn?.CurrentEffectiveVerb?.IsMeleeAttack ?? false) { UpdateNearestEnemyMelee(enemyPawn); }