From 4c1f34ff39c9ab59991648cc1a7c771ef7b1d8a2 Mon Sep 17 00:00:00 2001
From: J10a1n15 <45315647+j10a1n15@users.noreply.github.com>
Date: Sat, 22 Jun 2024 08:42:49 +0200
Subject: Fix: Custom Wardrobe Price Error (#2123)

Co-authored-by: Empa <42304516+ItsEmpa@users.noreply.github.com>
---
 .../at/hannibal2/skyhanni/features/inventory/wardrobe/WardrobeAPI.kt   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src/main/java')

diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/WardrobeAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/WardrobeAPI.kt
index f57761102..c977bb031 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/WardrobeAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/wardrobe/WardrobeAPI.kt
@@ -9,6 +9,7 @@ import at.hannibal2.skyhanni.features.misc.items.EstimatedItemValueCalculator
 import at.hannibal2.skyhanni.skyhannimodule.SkyHanniModule
 import at.hannibal2.skyhanni.utils.DelayedRun
 import at.hannibal2.skyhanni.utils.InventoryUtils
+import at.hannibal2.skyhanni.utils.ItemUtils.getInternalNameOrNull
 import at.hannibal2.skyhanni.utils.ItemUtils.name
 import at.hannibal2.skyhanni.utils.LorenzUtils
 import at.hannibal2.skyhanni.utils.NumberUtil.formatInt
@@ -94,7 +95,7 @@ object WardrobeAPI {
         if (slot.isEmpty()) return@buildList
         add("§aEstimated Armor Value:")
         var totalPrice = 0.0
-        for (stack in slot.armor.filterNotNull()) {
+        for (stack in slot.armor.filterNotNull().filter { it.getInternalNameOrNull() != null }) {
             val price = EstimatedItemValueCalculator.getTotalPrice(stack)
             add("  §7- ${stack.name}: §6${price.shortFormat()}")
             totalPrice += price
-- 
cgit