From 998e57bd7d7c5e2855c434aa9b81a4f82507112f Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Thu, 4 Jan 2024 11:14:06 +0100 Subject: Fixed tuningData crash on PV (#993) --- .../moulberry/notenoughupdates/profileviewer/SkyblockProfiles.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/io') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/SkyblockProfiles.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/SkyblockProfiles.java index a8fd019c..fc9ec444 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/SkyblockProfiles.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/SkyblockProfiles.java @@ -722,7 +722,11 @@ public class SkyblockProfiles { JsonObject profileJson = getProfileJson(); if (Utils.getElement(profileJson, "accessory_bag_storage.tuning") == null) return null; - JsonObject tuningData = Utils.getElement(profileJson, "accessory_bag_storage.tuning.slot_0").getAsJsonObject(); + JsonObject tuningData = Utils.getElementOrDefault( + profileJson, + "accessory_bag_storage.tuning.slot_0", + new JsonObject() + ).getAsJsonObject(); if (tuningData.entrySet().isEmpty()) return null; tuningInfo = new LinkedHashMap<>(); -- cgit