aboutsummaryrefslogtreecommitdiff
path: root/me/Danker
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2020-07-24 00:36:48 -0400
committerbowser0000 <bowser0000@gmail.com>2020-07-24 00:36:48 -0400
commit17643172df0eec7521996b786ea3f74bae8acb43 (patch)
tree0858b5b96daf040d8ffe2774e69f5206ee768199 /me/Danker
parent0f36b9862ce9d49c45e4bb53a913a37477181992 (diff)
downloadSkyblockMod-17643172df0eec7521996b786ea3f74bae8acb43.tar.gz
SkyblockMod-17643172df0eec7521996b786ea3f74bae8acb43.tar.bz2
SkyblockMod-17643172df0eec7521996b786ea3f74bae8acb43.zip
Fix rare case of no last_save
Diffstat (limited to 'me/Danker')
-rw-r--r--me/Danker/handlers/APIHandler.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/me/Danker/handlers/APIHandler.java b/me/Danker/handlers/APIHandler.java
index 67527b3..e81b1f1 100644
--- a/me/Danker/handlers/APIHandler.java
+++ b/me/Danker/handlers/APIHandler.java
@@ -125,7 +125,10 @@ public class APIHandler {
for (JsonElement profile : profilesArray) {
JsonObject profileJSON = profile.getAsJsonObject();
- long profileLastSave = profileJSON.get("members").getAsJsonObject().get(UUID).getAsJsonObject().get("last_save").getAsLong();
+ long profileLastSave = 0;
+ if (profileJSON.get("members").getAsJsonObject().get(UUID).getAsJsonObject().has("last_save")) {
+ profileLastSave = profileJSON.get("members").getAsJsonObject().get(UUID).getAsJsonObject().get("last_save").getAsLong();
+ }
if (profileLastSave > latestSave) {
latestProfile = profileJSON.get("profile_id").getAsString();