aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorefefury <69400149+efefury@users.noreply.github.com>2023-03-05 20:20:10 +0000
committerGitHub <noreply@github.com>2023-03-06 07:20:10 +1100
commitcf1be847a0552fe04ef29eb56a13b4a30e9006fe (patch)
treebd5d98bee42c733f0792d8ccb61c6c0e43cf58f7 /src/main
parent5a79ff410eb64e906c555751b32bef87cc7caee9 (diff)
downloadNotEnoughUpdates-cf1be847a0552fe04ef29eb56a13b4a30e9006fe.tar.gz
NotEnoughUpdates-cf1be847a0552fe04ef29eb56a13b4a30e9006fe.tar.bz2
NotEnoughUpdates-cf1be847a0552fe04ef29eb56a13b4a30e9006fe.zip
Fix NPE in Level Page v4 (#649)
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/MiscTaskLevel.java2
1 files changed, 1 insertions, 1 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 c9ba7636..f78052f5 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
@@ -88,7 +88,7 @@ public class MiscTaskLevel {
// abiphone
JsonObject leveling = object.getAsJsonObject("leveling");
- if (leveling.has("completed_tasks")) {
+ if (leveling != null && leveling.has("completed_tasks")) {
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();