From 51552fc700c00f5ff88eb8a49fce84360f41915a Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 29 Oct 2023 18:50:42 +0100 Subject: better error logging --- .../skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt index c65c235a5..31c606d55 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt @@ -63,7 +63,9 @@ class ItemDisplayOverlayFeatures { val chestName = InventoryUtils.openInventoryName() if (!chestName.endsWith("Sea Creature Guide") && ItemUtils.isPet(itemName)) { petLevelPattern.matchMatcher(itemName) { - val level = group("level").toInt() + val rawLevel = group("level") + val level = rawLevel.toIntOrNull() + ?: throw IllegalStateException("pet level not found for item name '$itemName'") if (level != ItemUtils.maxPetLevel(itemName)) { return "$level" } @@ -163,4 +165,4 @@ class ItemDisplayOverlayFeatures { } return text } -} \ No newline at end of file +} -- cgit