From 6d2837bee6b7e51af6eb37056fcd5609b79ce8a7 Mon Sep 17 00:00:00 2001 From: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:50:39 +0200 Subject: [PATCH] fix(webui): use optional chaining operator for `maxLevelCap` For items that not in itemMap --- static/webui/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/webui/script.js b/static/webui/script.js index ab1a894d..697631cd 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -832,7 +832,7 @@ function updateInventory() { const td = document.createElement("td"); td.classList = "text-end text-nowrap"; - let maxXP = Math.pow(itemMap[item.ItemType].maxLevelCap ?? 30, 2) * 1000; + let maxXP = Math.pow(itemMap[item.ItemType]?.maxLevelCap ?? 30, 2) * 1000; if ( category != "Suits" && category != "SpaceSuits" && @@ -859,7 +859,7 @@ function updateInventory() { } } if ( - itemMap[item.ItemType].maxLevelCap > 30 && + itemMap[item.ItemType]?.maxLevelCap > 30 && (item.Polarized ?? 0) < (itemMap[item.ItemType].maxLevelCap - 30) / 2 ) { const a = document.createElement("a");