aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
diff options
context:
space:
mode:
authorLulonaut <67191924+Lulonaut@users.noreply.github.com>2022-06-22 14:41:15 +0200
committerGitHub <noreply@github.com>2022-06-22 14:41:15 +0200
commitf34220a92af85a33d979edb24ac5c3e698498fe3 (patch)
treed36bcc12b1fd4116003c1c36cb09666f0e3f36c1 /src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java
parent439fc22ff04b0f5b0201c2d982bceb18d82fd553 (diff)
downloadnotenoughupdates-f34220a92af85a33d979edb24ac5c3e698498fe3.tar.gz
notenoughupdates-f34220a92af85a33d979edb24ac5c3e698498fe3.tar.bz2
notenoughupdates-f34220a92af85a33d979edb24ac5c3e698498fe3.zip
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
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java10
1 files changed, 7 insertions, 3 deletions
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(),