From f34220a92af85a33d979edb24ac5c3e698498fe3 Mon Sep 17 00:00:00 2001 From: Lulonaut <67191924+Lulonaut@users.noreply.github.com> Date: Wed, 22 Jun 2022 14:41:15 +0200 Subject: bug fixes (#172) * yikes * cookie warning * better wording in docs * edit items in parent that are the bounds of the item list * totalCount not updating when not present * unplayable * comment? * outdated repo notification * more notification * crash * more crash * cookie bug --- .../notenoughupdates/profileviewer/ProfileViewer.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java index 9da55d64..d8e47fa3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java @@ -862,8 +862,10 @@ public class ProfileViewer { if (profileId == null) profileId = latestProfile; if (skillInfoMap.containsKey(profileId)) return skillInfoMap.get(profileId); JsonObject leveling = Constants.LEVELING; - if (leveling == null) return null; - + if (leveling == null || !leveling.has("social")) { + Utils.showOutdatedRepoNotification(); + return null; + } float experience_skill_taming = Utils.getElementAsFloat(Utils.getElement(profileInfo, "experience_skill_taming"), 0); float experience_skill_mining = @@ -952,7 +954,9 @@ public class ProfileViewer { Level level_skill_runecrafting = getLevel(Utils.getElement(leveling, "runecrafting_xp").getAsJsonArray(), experience_skill_runecrafting, getCap(leveling, "runecrafting"), false ); - Level level_skill_social = getLevel(Utils.getElement(leveling, "social").getAsJsonArray(), + Level level_skill_social = getLevel(Utils + .getElementOrDefault(leveling, "social", new JsonArray()) + .getAsJsonArray(), experience_skill_social, getCap(leveling, "social"), false ); Level level_skill_catacombs = getLevel(Utils.getElement(leveling, "catacombs").getAsJsonArray(), -- cgit