aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/MiscTaskLevel.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/MiscTaskLevel.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/MiscTaskLevel.java
index 291bf4cf..c0bb9319 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/MiscTaskLevel.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/MiscTaskLevel.java
@@ -74,7 +74,7 @@ public class MiscTaskLevel extends GuiTaskLevel {
JsonObject netherIslandPlayerData = object.getAsJsonObject("nether_island_player_data");
JsonObject abiphoneObject = netherIslandPlayerData.getAsJsonObject("abiphone");
- if (abiphoneObject.has("operator_chip") &&
+ if (abiphoneObject != null && abiphoneObject.has("operator_chip") &&
abiphoneObject.getAsJsonObject("operator_chip").has("repaired_index")) {
int repairedIndex = abiphoneObject.getAsJsonObject("operator_chip").get("repaired_index").getAsInt();
sbXpRelays += (repairedIndex + 1) * miscellaneousTask.get("unlocking_relays_xp").getAsInt();
@@ -104,7 +104,7 @@ public class MiscTaskLevel extends GuiTaskLevel {
JsonArray completedTask = leveling.get("completed_tasks").getAsJsonArray();
Stream<JsonElement> stream = StreamSupport.stream(completedTask.spliterator(), true);
long activeContacts = stream.map(JsonElement::getAsString).filter(s -> s.startsWith("ABIPHONE_")).count();
- if (abiphoneObject.has("active_contacts")) {
+ if (abiphoneObject != null && abiphoneObject.has("active_contacts")) {
sbXpAbiphone = (int) activeContacts * miscellaneousTask.get("abiphone_contacts_xp").getAsInt();
}
}