From cdea68443a0b917656e50e2c0dad45d95544baeb Mon Sep 17 00:00:00 2001 From: snowleo Date: Thu, 23 Jun 2011 12:22:52 +0200 Subject: Only get data from valid rows Fixes #641 --- .../src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'EssentialsProtect') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java index 1d09f95c4..e6b3c7592 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/data/ProtectedBlockJDBC.java @@ -272,8 +272,7 @@ public abstract class ProtectedBlockJDBC implements IProtectedBlock conn = cpds.getConnection(); ps = getStatementPlayerCountByLocation(conn, block.getWorld().getName(), block.getX(), block.getY(), block.getZ(), playerName); rs = ps.executeQuery(); - rs.next(); - return rs.getInt(1) > 0 && rs.getInt(2) == 0; + return rs.next() && rs.getInt(1) > 0 && rs.getInt(2) == 0; } catch (SQLException ex) { -- cgit v1.2.3