aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-29 18:50:42 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-29 18:50:42 +0100
commit51552fc700c00f5ff88eb8a49fce84360f41915a (patch)
tree7fd95deb6ea3294efe733cb0bdbd9a7d8b59a51f
parent684f7ac0973cb531aca6b10f2e5f2f8576401caf (diff)
downloadskyhanni-51552fc700c00f5ff88eb8a49fce84360f41915a.tar.gz
skyhanni-51552fc700c00f5ff88eb8a49fce84360f41915a.tar.bz2
skyhanni-51552fc700c00f5ff88eb8a49fce84360f41915a.zip
better error logging
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt6
1 files changed, 4 insertions, 2 deletions
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
+}