From 921ee1faa468d69fb70d2698fb210fc3eb61170d Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 27 Jul 2023 22:02:29 +0200 Subject: more debug information if trophy fish data failed to load correctly --- .../at/hannibal2/skyhanni/features/fishing/TrophyFishFillet.kt | 1 - .../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, rarity: TrophyRarity): String { val count = counts.getOrDefault(rarity, 0) -- cgit