aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorefefury <69400149+efefury@users.noreply.github.com>2023-02-16 11:51:40 +0000
committerGitHub <noreply@github.com>2023-02-16 12:51:40 +0100
commit1d75ac44c20fafd9f834dc7c01066a85a74f89e7 (patch)
treec91d7995c9d45eabacb46bcdfe5a3cfb6c4088a5
parent7c0a3b571109969621641d1790ee2efd72e7edf6 (diff)
downloadNotEnoughUpdates-1d75ac44c20fafd9f834dc7c01066a85a74f89e7.tar.gz
NotEnoughUpdates-1d75ac44c20fafd9f834dc7c01066a85a74f89e7.tar.bz2
NotEnoughUpdates-1d75ac44c20fafd9f834dc7c01066a85a74f89e7.zip
Fix NPE in Level Page (v2) (#617)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/CoreTaskLevel.java6
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();
}