aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjani270 <69345714+jani270@users.noreply.github.com>2023-11-25 14:00:54 +0100
committerGitHub <noreply@github.com>2023-11-26 00:00:54 +1100
commitfc03e99d9e48e473567f879a8b54125ecc793191 (patch)
tree4346f310b96927c06bd8106a0f81f8b29363e60b /src
parent05690a6435da65e1445c34f0d3c8866de2c0245d (diff)
downloadNotEnoughUpdates-fc03e99d9e48e473567f879a8b54125ecc793191.tar.gz
NotEnoughUpdates-fc03e99d9e48e473567f879a8b54125ecc793191.tar.bz2
NotEnoughUpdates-fc03e99d9e48e473567f879a8b54125ecc793191.zip
Fixed Levelpage crash because of no kuudra comps (#952)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/SlayingTaskLevel.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/SlayingTaskLevel.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/SlayingTaskLevel.java
index 1e33c3ea..3a64b257 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/SlayingTaskLevel.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/SlayingTaskLevel.java
@@ -139,9 +139,12 @@ public class SlayingTaskLevel extends GuiTaskLevel {
int kuudraBossCollection = 0;
if (object.has("nether_island_player_data")) {
- JsonObject jsonObject = object.getAsJsonObject("nether_island_player_data").getAsJsonObject(
- "kuudra_completed_tiers");
- for (Map.Entry<String, JsonElement> stringJsonElementEntry : jsonObject.entrySet()) {
+ JsonObject kuudraCompletedTiers = Utils.getElementOrDefault(
+ selectedProfile.getProfileJson(),
+ "nether_island_player_data.kuudra_completed_tiers",
+ new JsonObject()
+ ).getAsJsonObject();
+ for (Map.Entry<String, JsonElement> stringJsonElementEntry : kuudraCompletedTiers.entrySet()) {
String key = stringJsonElementEntry.getKey();
int value = stringJsonElementEntry.getValue().getAsInt();