diff options
author | jani270 <69345714+jani270@users.noreply.github.com> | 2023-11-25 14:05:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-26 00:05:37 +1100 |
commit | 73ee7b53c360bb910f09190b4e01f214112c44cd (patch) | |
tree | 05ad50a6c241c51b9fafa5f08b63f9f5adf83d3c /src/main/java | |
parent | 67de5c5e4595ffe87128996b162bade99bcf6f36 (diff) | |
download | NotEnoughUpdates-73ee7b53c360bb910f09190b4e01f214112c44cd.tar.gz NotEnoughUpdates-73ee7b53c360bb910f09190b4e01f214112c44cd.tar.bz2 NotEnoughUpdates-73ee7b53c360bb910f09190b4e01f214112c44cd.zip |
Fixed crash on levels page because people dont have objectives (#948)
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/profileviewer/level/task/StoryTaskLevel.java | 4 |
1 files changed, 2 insertions, 2 deletions
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; } } |