diff options
author | bowser0000 <bowser0000@gmail.com> | 2020-07-24 00:36:48 -0400 |
---|---|---|
committer | bowser0000 <bowser0000@gmail.com> | 2020-07-24 00:36:48 -0400 |
commit | 17643172df0eec7521996b786ea3f74bae8acb43 (patch) | |
tree | 0858b5b96daf040d8ffe2774e69f5206ee768199 /me | |
parent | 0f36b9862ce9d49c45e4bb53a913a37477181992 (diff) | |
download | SkyblockMod-17643172df0eec7521996b786ea3f74bae8acb43.tar.gz SkyblockMod-17643172df0eec7521996b786ea3f74bae8acb43.tar.bz2 SkyblockMod-17643172df0eec7521996b786ea3f74bae8acb43.zip |
Fix rare case of no last_save
Diffstat (limited to 'me')
-rw-r--r-- | me/Danker/handlers/APIHandler.java | 5 |
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(); |