From 6ddaf8dec8f08056aad6b7f4cee428db96ba7571 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Sat, 2 Sep 2017 12:51:40 +0300 Subject: [PATCH] Fixes Clean SQLException of TPS Table --- .../com/djrapitops/plan/database/tables/TPSTable.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Plan/src/main/java/com/djrapitops/plan/database/tables/TPSTable.java b/Plan/src/main/java/com/djrapitops/plan/database/tables/TPSTable.java index a5c81dfc9..341eaa9e4 100644 --- a/Plan/src/main/java/com/djrapitops/plan/database/tables/TPSTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/database/tables/TPSTable.java @@ -132,12 +132,18 @@ public class TPSTable extends Table { * @throws SQLException */ public void clean() throws SQLException { + Optional allTimePeak = getAllTimePeak(); + int p = -1; + if (allTimePeak.isPresent()) { + p = allTimePeak.get().getPlayers(); + } PreparedStatement statement = null; try { statement = prepareStatement("DELETE FROM " + tableName + " WHERE (" + columnDate + "