aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjani270 <69345714+jani270@users.noreply.github.com>2024-01-04 11:14:06 +0100
committerGitHub <noreply@github.com>2024-01-04 11:14:06 +0100
commit998e57bd7d7c5e2855c434aa9b81a4f82507112f (patch)
tree0d7254949002487e487f1a0bb2ade20f2871a0ba /src
parent193c0c8acd7dfefadd496b50ce2ecf2ff12a35f7 (diff)
downloadNotEnoughUpdates-998e57bd7d7c5e2855c434aa9b81a4f82507112f.tar.gz
NotEnoughUpdates-998e57bd7d7c5e2855c434aa9b81a4f82507112f.tar.bz2
NotEnoughUpdates-998e57bd7d7c5e2855c434aa9b81a4f82507112f.zip
Fixed tuningData crash on PV (#993)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/SkyblockProfiles.java6
1 files changed, 5 insertions, 1 deletions
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<>();