From 37aecf7dc221b529d27ed38a39558cf1b4bac69b Mon Sep 17 00:00:00 2001 From: Neon Date: Sun, 16 Jun 2024 02:31:14 +0200 Subject: [PATCH] Fix SQLExceptions --- .../src/com/aionemu/gameserver/dao/LegionMemberDAO.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/game-server/src/com/aionemu/gameserver/dao/LegionMemberDAO.java b/game-server/src/com/aionemu/gameserver/dao/LegionMemberDAO.java index 173c52b39..6e7ac5d73 100644 --- a/game-server/src/com/aionemu/gameserver/dao/LegionMemberDAO.java +++ b/game-server/src/com/aionemu/gameserver/dao/LegionMemberDAO.java @@ -97,7 +97,8 @@ public void setParams(PreparedStatement stmt) throws SQLException { @Override public void handleRead(ResultSet resultSet) { try { - resultSet.next(); + if (!resultSet.next()) + return; int legionId = resultSet.getInt("legion_id"); legionMember.setRank(LegionRank.valueOf(resultSet.getString("rank"))); legionMember.setNickname(resultSet.getString("nickname")); @@ -129,7 +130,8 @@ public void setParams(PreparedStatement stmt) throws SQLException { @Override public void handleRead(ResultSet resultSet) { try { - resultSet.next(); + if (!resultSet.next()) + return; legionMemberEx.setName(resultSet.getString("players.name")); legionMemberEx.setPlayerClass(PlayerClass.valueOf(resultSet.getString("players.player_class"))); legionMemberEx.setLevelByExp(resultSet.getLong("players.exp")); @@ -167,7 +169,8 @@ public void setParams(PreparedStatement stmt) throws SQLException { @Override public void handleRead(ResultSet resultSet) { try { - resultSet.next(); + if (!resultSet.next()) + return; legionMember.setObjectId(resultSet.getInt("id")); legionMember.setPlayerClass(PlayerClass.valueOf(resultSet.getString("player_class"))); legionMember.setLevelByExp(resultSet.getLong("exp"));