From 73ee7b53c360bb910f09190b4e01f214112c44cd Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Sat, 25 Nov 2023 14:05:37 +0100 Subject: Fixed crash on levels page because people dont have objectives (#948) --- .../notenoughupdates/profileviewer/level/task/StoryTaskLevel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/StoryTaskLevel.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/StoryTaskLevel.java index 1cda3e01..a55c8cff 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/StoryTaskLevel.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/StoryTaskLevel.java @@ -46,9 +46,9 @@ public class StoryTaskLevel extends GuiTaskLevel { int sbXpStory = 0; for (JsonElement storyTaskName : storyTaskNames) { String value = storyTaskName.getAsString(); - if (objectives.has(value)) { + if (objectives != null && objectives.has(value)) { JsonObject jsonObject = objectives.get(value).getAsJsonObject(); - if (jsonObject.has("status") && jsonObject.get("status").getAsString().equals("COMPLETE")) { + if (jsonObject != null && jsonObject.has("status") && jsonObject.get("status").getAsString().equals("COMPLETE")) { sbXpStory += storyTaskXp; } } -- cgit