Only get data from valid rows

Fixes #641
This commit is contained in:
snowleo 2011-06-23 12:22:52 +02:00
parent 5d8f5cecee
commit cdea68443a

View file

@ -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)
{