From 0b160cd579b587732cef375818983c72c077444e Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 29 Aug 2020 11:22:21 +0200 Subject: [PATCH] Hotfix IgnoreSystem Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/sql/IgnoreSystem.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/sql/IgnoreSystem.java b/src/de/steamwar/bungeecore/sql/IgnoreSystem.java index 1d99cd5..d8f42f9 100644 --- a/src/de/steamwar/bungeecore/sql/IgnoreSystem.java +++ b/src/de/steamwar/bungeecore/sql/IgnoreSystem.java @@ -2,6 +2,7 @@ package de.steamwar.bungeecore.sql; import net.md_5.bungee.api.connection.ProxiedPlayer; +import java.sql.ResultSet; import java.sql.SQLException; public class IgnoreSystem{ @@ -15,7 +16,11 @@ public class IgnoreSystem{ public static boolean isIgnored(SteamwarUser ignorer, SteamwarUser ignored) { try { - return !SQL.select("SELECT * FROM IgnoredPlayers WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()).next(); + ResultSet rs = SQL.select("SELECT COUNT(*) AS blocked FROM IgnoredPlayers WHERE Ignorer = ? AND Ignored = ?", ignorer.getId(), ignored.getId()); + if(!rs.next()) + return false; + + return rs.getInt("blocked") > 0; } catch (SQLException e) { throw new SecurityException("Could not check if ignored", e); }