From fc03e99d9e48e473567f879a8b54125ecc793191 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Sat, 25 Nov 2023 14:00:54 +0100 Subject: Fixed Levelpage crash because of no kuudra comps (#952) --- .../profileviewer/level/task/SlayingTaskLevel.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/main/java/io') 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 stringJsonElementEntry : jsonObject.entrySet()) { + JsonObject kuudraCompletedTiers = Utils.getElementOrDefault( + selectedProfile.getProfileJson(), + "nether_island_player_data.kuudra_completed_tiers", + new JsonObject() + ).getAsJsonObject(); + for (Map.Entry stringJsonElementEntry : kuudraCompletedTiers.entrySet()) { String key = stringJsonElementEntry.getKey(); int value = stringJsonElementEntry.getValue().getAsInt(); -- cgit