diff --git a/Patches/ItemPanelPatches.cs b/Patches/ItemPanelPatches.cs index 3e86bf3..0605879 100644 --- a/Patches/ItemPanelPatches.cs +++ b/Patches/ItemPanelPatches.cs @@ -116,10 +116,15 @@ namespace UIFixes [PatchPrefix] private static void Prefix(Item compareItem) { - if (compareItem is ArmorClass) + if (compareItem == null) + { + return; + } + + // Armor points is added in method_5, but not in other places so it's missed by compare + ArmorComponent[] armorComponents = compareItem.GetItemComponentsInChildren(true).Where(c => c.ArmorClass > 0).ToArray(); + if (armorComponents.Any()) { - // Armor points is added in method_5, but not in other places so it's missed by compare - ArmorComponent[] armorComponents = compareItem.GetItemComponentsInChildren(true).Where(c => c.ArmorClass > 0).ToArray(); float maxDurability = armorComponents.Sum(c => c.Repairable.Durability); ItemAttributeClass itemAttributeClass = new ItemAttributeClass(EItemAttributeId.ArmorPoints);