diff options
| author | jani270 <69345714+jani270@users.noreply.github.com> | 2023-12-01 12:53:27 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-01 12:53:27 +0100 |
| commit | a1b74ca22b8079455d5caabc8f5cc6613a85f285 (patch) | |
| tree | 2a1059b7313fc80d146d4173fc9952612f7b6079 /src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java | |
| parent | 31704187c8527b03199e5abdddb982327ccfac53 (diff) | |
| download | notenoughupdates-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.java | 4 |
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()) { |
