diff options
author | kr45732 <52721908+kr45732@users.noreply.github.com> | 2023-07-09 14:04:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-09 20:04:43 +0200 |
commit | 3249b2c36d3af4d5d6014385fb7a1ce143dadf31 (patch) | |
tree | 81e50f5d5a20a2675b8ed24a2c4a8d0f6a6006b4 /src | |
parent | 4d285aac350aa5498c5362f610fa82cb73331f96 (diff) | |
download | NotEnoughUpdates-3249b2c36d3af4d5d6014385fb7a1ce143dadf31.tar.gz NotEnoughUpdates-3249b2c36d3af4d5d6014385fb7a1ce143dadf31.tar.bz2 NotEnoughUpdates-3249b2c36d3af4d5d6014385fb7a1ce143dadf31.zip |
Fix leveling info related crash (#767)
Diffstat (limited to 'src')
3 files changed, 15 insertions, 4 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java index 66c7c2a1..980a488f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java @@ -127,6 +127,9 @@ public class DungeonPage extends GuiProfileViewerPage { } Map<String, ProfileViewer.Level> levelingInfo = selectedProfile.getLevelingInfo(); + if (levelingInfo == null) { + return; + } JsonObject profileInfo = selectedProfile.getProfileJson(); JsonObject hypixelInfo = GuiProfileViewer.getProfile().getHypixelProfile(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java index c0824bf5..792b1b80 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java @@ -19,6 +19,7 @@ package io.github.moulberry.notenoughupdates.profileviewer; +import io.github.moulberry.notenoughupdates.profileviewer.ProfileViewer; import com.google.common.collect.Lists; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.core.util.StringUtils; @@ -151,11 +152,15 @@ public class MiningPage extends GuiProfileViewerPage { molePerkPct = 100; } - ProfileViewer.Level hotmLevelingInfo = selectedProfile.getLevelingInfo().get("hotm"); - // Render stats - // HOTM - getInstance().renderXpBar(EnumChatFormatting.RED + "HOTM", hotmSkillIcon, x, y, sectionWidth, hotmLevelingInfo, mouseX, mouseY); + Map<String, ProfileViewer.Level> levelingInfo = selectedProfile.getLevelingInfo(); + if (levelingInfo != null) { + ProfileViewer.Level hotmLevelingInfo = levelingInfo.get("hotm"); + + // HOTM + getInstance().renderXpBar(EnumChatFormatting.RED + "HOTM", hotmSkillIcon, x, y, sectionWidth, hotmLevelingInfo, mouseX, mouseY); + } + // Powder Utils.renderAlignedString( diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java index c4c85597..0a501415 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java @@ -233,6 +233,9 @@ public class XPInformation { private void onApiUpdated(SkyblockProfiles profile) { Map<String, ProfileViewer.Level> skyblockInfo = profile.getLatestProfile().getLevelingInfo(); + if (skyblockInfo == null) { + return; + } for (String skill : skills) { SkillInfo info = new SkillInfo(); |