diff --git a/Plugins/Mineplex.Core/src/mineplex/core/elo/EloRepository.java b/Plugins/Mineplex.Core/src/mineplex/core/elo/EloRepository.java index b38628d87..24b0cfebc 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/elo/EloRepository.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/elo/EloRepository.java @@ -93,20 +93,34 @@ public class EloRepository extends MinecraftRepository public void getStrikeExpiry(int accountId, Callback call) { Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> executeQuery(GRAB_STRIKE_EXPIRY, resultSet -> { + boolean called = false; while (resultSet.next()) { + called = true; call.run(resultSet.getLong(1)); } + + if (!called) + { + call.run(0L); + } }, new ColumnInt("accountId", accountId))); } public void getBanExpiryAsync(int accountId, Callback call) { Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> executeQuery(GRAB_BAN_EXPIRY, resultSet -> { + boolean called = false; while (resultSet.next()) { + called = true; call.run(resultSet.getLong(1)); } + + if (!called) + { + call.run(0L); + } }, new ColumnInt("accountId", accountId))); } @@ -129,10 +143,17 @@ public class EloRepository extends MinecraftRepository public void getStrikes(int accountId, Callback call) { Bukkit.getScheduler().runTaskAsynchronously(getPlugin(), () -> executeQuery(GRAB_STRIKES, resultSet -> { + boolean called = false; while (resultSet.next()) { + called = true; call.run(resultSet.getInt(1)); } + + if (!called) + { + call.run(0); + } }, new ColumnInt("accountId", accountId))); }