diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishFillet.kt | 1 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishInfo.kt | 9 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishFillet.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishFillet.kt index 32d31595b..69e1a0efc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishFillet.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishFillet.kt @@ -3,7 +3,6 @@ package at.hannibal2.skyhanni.features.fishing import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.LorenzToolTipEvent import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName -import at.hannibal2.skyhanni.utils.ItemUtils.name import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.NumberUtil diff --git a/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishInfo.kt b/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishInfo.kt index 629aaa02f..395fea310 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishInfo.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishInfo.kt @@ -1,5 +1,6 @@ package at.hannibal2.skyhanni.features.fishing +import at.hannibal2.skyhanni.test.command.CopyErrorCommand import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.StringUtils.splitLines import com.google.gson.annotations.Expose @@ -37,7 +38,13 @@ data class TrophyFishInfo( ) } - fun getFilletValue(rarity: TrophyRarity) = fillet.getOrDefault(rarity, -1) + fun getFilletValue(rarity: TrophyRarity): Int { + if (fillet == null) { + CopyErrorCommand.logError(Error("fillet is null for '$displayName'"), "Error trying to read trophy fish info") + return -1 + } + return fillet.getOrDefault(rarity, -1) + } private fun formatCount(counts: Map<TrophyRarity, Int>, rarity: TrophyRarity): String { val count = counts.getOrDefault(rarity, 0) |