aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java
diff options
context:
space:
mode:
authorjani270 <69345714+jani270@users.noreply.github.com>2023-12-01 12:53:27 +0100
committerGitHub <noreply@github.com>2023-12-01 12:53:27 +0100
commita1b74ca22b8079455d5caabc8f5cc6613a85f285 (patch)
tree2a1059b7313fc80d146d4173fc9952612f7b6079 /src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java
parent31704187c8527b03199e5abdddb982327ccfac53 (diff)
downloadnotenoughupdates-a1b74ca22b8079455d5caabc8f5cc6613a85f285.tar.gz
notenoughupdates-a1b74ca22b8079455d5caabc8f5cc6613a85f285.tar.bz2
notenoughupdates-a1b74ca22b8079455d5caabc8f5cc6613a85f285.zip
Fixed 2 crashes in pv (#963)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java
index d7eb6adb..8b8285c6 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java
@@ -466,7 +466,7 @@ public class ExtraPage extends GuiProfileViewerPage {
if (topKills == null) {
topKills = new TreeMap<>();
- JsonObject stats = profileInfo.get("stats").getAsJsonObject();
+ JsonObject stats = Utils.getElementOrDefault(profileInfo, "stats", new JsonObject()).getAsJsonObject();
for (Map.Entry<String, JsonElement> entry : stats.entrySet()) {
if (entry.getKey().startsWith("kills_")) {
if (entry.getValue().isJsonPrimitive()) {
@@ -482,7 +482,7 @@ public class ExtraPage extends GuiProfileViewerPage {
}
if (topDeaths == null) {
topDeaths = new TreeMap<>();
- JsonObject stats = profileInfo.get("stats").getAsJsonObject();
+ JsonObject stats = Utils.getElementOrDefault(profileInfo, "stats", new JsonObject()).getAsJsonObject();
for (Map.Entry<String, JsonElement> entry : stats.entrySet()) {
if (entry.getKey().startsWith("deaths_")) {
if (entry.getValue().isJsonPrimitive()) {