diff options
author | efefury <69400149+efefury@users.noreply.github.com> | 2023-02-16 11:51:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-16 12:51:40 +0100 |
commit | 1d75ac44c20fafd9f834dc7c01066a85a74f89e7 (patch) | |
tree | c91d7995c9d45eabacb46bcdfe5a3cfb6c4088a5 /src/main/java | |
parent | 7c0a3b571109969621641d1790ee2efd72e7edf6 (diff) | |
download | NotEnoughUpdates-1d75ac44c20fafd9f834dc7c01066a85a74f89e7.tar.gz NotEnoughUpdates-1d75ac44c20fafd9f834dc7c01066a85a74f89e7.tar.bz2 NotEnoughUpdates-1d75ac44c20fafd9f834dc7c01066a85a74f89e7.zip |
Fix NPE in Level Page (v2) (#617)
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/CoreTaskLevel.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/CoreTaskLevel.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/CoreTaskLevel.java index fde43cd1..8bb26b09 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/CoreTaskLevel.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/CoreTaskLevel.java @@ -82,14 +82,16 @@ public class CoreTaskLevel { // mp acc int sbXpGainedMp = 0; - if (object.has("accessory_bag_storage")) { + if (object.has("accessory_bag_storage") && + object.getAsJsonObject("accessory_bag_storage").has("highest_magical_power")) { sbXpGainedMp = object.getAsJsonObject("accessory_bag_storage").get("highest_magical_power").getAsInt(); } // pets int petScore = 0; - if (object.has("leveling") && object.getAsJsonObject("leveling").has("highest_pet_score")) { + if (object.has("leveling") && + object.getAsJsonObject("leveling").has("highest_pet_score")) { petScore = object.getAsJsonObject("leveling").get("highest_pet_score").getAsInt(); } |