diff options
Diffstat (limited to 'src/main/java/at/hannibal2')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/inventory/ItemDisplayOverlayFeatures.kt | 6 |
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 +} |