From c908066d28a5d77aea8b89ea620be3ad806ba064 Mon Sep 17 00:00:00 2001 From: Keebler408 <85420839+Keebler408@users.noreply.github.com> Date: Mon, 20 Dec 2021 15:03:51 -0600 Subject: Fix crash in profile viewer (#34) --- .../moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java index 227d52d0..1ae62b6c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -3910,7 +3910,7 @@ public class GuiProfileViewer extends GuiScreen { private String getTimeSinceString(JsonObject profileInfo, String path) { JsonElement lastSaveElement = Utils.getElement(profileInfo, path); - if (lastSaveElement.isJsonPrimitive()) { + if (lastSaveElement != null && lastSaveElement.isJsonPrimitive()) { Instant lastSave = Instant.ofEpochMilli(lastSaveElement.getAsLong()); LocalDateTime lastSaveTime = LocalDateTime.ofInstant(lastSave, TimeZone.getDefault().toZoneId()); -- cgit