From 2edf2592719b7a04e98b3742126f33af69e5b3ac Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 12 Jul 2023 18:21:21 +0100 Subject: [PATCH] prevent IsEnemyPatch enemy list check fail when it's null --- project/Aki.Custom/Patches/IsEnemyPatch.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/Aki.Custom/Patches/IsEnemyPatch.cs b/project/Aki.Custom/Patches/IsEnemyPatch.cs index 65099db..54bfd01 100644 --- a/project/Aki.Custom/Patches/IsEnemyPatch.cs +++ b/project/Aki.Custom/Patches/IsEnemyPatch.cs @@ -50,7 +50,7 @@ namespace Aki.Custom.Patches } // Check existing enemies list - if (__instance.Enemies.Any(x=> x.Value.Player.Id == requester.Id)) + if (!__instance.Enemies.IsNullOrEmpty() && __instance.Enemies.Any(x=> x.Value.Player.Id == requester.Id)) { isEnemy = true; }