From cf1be847a0552fe04ef29eb56a13b4a30e9006fe Mon Sep 17 00:00:00 2001 From: efefury <69400149+efefury@users.noreply.github.com> Date: Sun, 5 Mar 2023 20:20:10 +0000 Subject: Fix NPE in Level Page v4 (#649) --- .../notenoughupdates/profileviewer/level/task/MiscTaskLevel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 stream = StreamSupport.stream(completedTask.spliterator(), true); long activeContacts = stream.map(JsonElement::getAsString).filter(s -> s.startsWith("ABIPHONE_")).count(); -- cgit