diff options
author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2022-10-21 14:41:44 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-21 07:41:44 -0700 |
commit | 6c209c2ca6b4cb858cec2854d665bfa1a44f8728 (patch) | |
tree | 68df3a19a70d57a24605734dde448bafe7a1ebd3 | |
parent | 72adbc192fc53cd90408f4382b66310d77e2be2a (diff) | |
download | NotEnoughUpdates-6c209c2ca6b4cb858cec2854d665bfa1a44f8728.tar.gz NotEnoughUpdates-6c209c2ca6b4cb858cec2854d665bfa1a44f8728.tar.bz2 NotEnoughUpdates-6c209c2ca6b4cb858cec2854d665bfa1a44f8728.zip |
Fix fish related crash (#387)
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java index 7fc9bd0d..1db53267 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java @@ -26,14 +26,6 @@ import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewerPage; import io.github.moulberry.notenoughupdates.util.Utils; - -import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; @@ -46,6 +38,7 @@ import org.apache.commons.lang3.text.WordUtils; import org.apache.commons.lang3.tuple.Pair; import org.lwjgl.opengl.GL11; +import java.text.NumberFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -366,8 +359,11 @@ public class TrophyFishPage extends GuiProfileViewerPage { tooltip.add(display(trophyFishRarityIntegerMap, TrophyFish.TrophyFishRarity.GOLD, EnumChatFormatting.GOLD)); tooltip.add(display(trophyFishRarityIntegerMap, TrophyFish.TrophyFishRarity.SILVER, EnumChatFormatting.GRAY)); tooltip.add(display(trophyFishRarityIntegerMap, TrophyFish.TrophyFishRarity.BRONZE, EnumChatFormatting.DARK_GRAY)); - tooltip.add(" "); - tooltip.add(EnumChatFormatting.GRAY + "Total: " + EnumChatFormatting.GOLD + NUMBER_FORMAT.format(trophyFishList.get(name).getTotal())); + if (trophyFishList.get(name) != null) { + tooltip.add(" "); + tooltip.add(EnumChatFormatting.GRAY + "Total: " + EnumChatFormatting.GOLD + + NUMBER_FORMAT.format(trophyFishList.get(name).getTotal())); + } return tooltip; } |