diff --git a/src/engine/db/handlers/dbBuildingHandler.java b/src/engine/db/handlers/dbBuildingHandler.java index a7696dae..2e4191ca 100644 --- a/src/engine/db/handlers/dbBuildingHandler.java +++ b/src/engine/db/handlers/dbBuildingHandler.java @@ -69,10 +69,12 @@ public class dbBuildingHandler extends dbHandlerBase { ResultSet rs = preparedStatement.executeQuery(); - int objectUUID = (int) rs.getLong("UID"); + if (rs.next()) { + int objectUUID = (int) rs.getLong("UID"); - if (objectUUID > 0) - building = GET_BUILDINGBYUUID(objectUUID); + if (objectUUID > 0) + building = GET_BUILDINGBYUUID(objectUUID); + } } catch (SQLException e) { throw new RuntimeException(e); diff --git a/src/engine/db/handlers/dbGuildHandler.java b/src/engine/db/handlers/dbGuildHandler.java index d4917eef..159c2bee 100644 --- a/src/engine/db/handlers/dbGuildHandler.java +++ b/src/engine/db/handlers/dbGuildHandler.java @@ -433,11 +433,12 @@ public class dbGuildHandler extends dbHandlerBase { ResultSet rs = preparedStatement.executeQuery(); - int objectUUID = (int) rs.getLong("UID"); - - if (objectUUID > 0) - guild = GET_GUILD(objectUUID); + if (rs.next()) { + int objectUUID = (int) rs.getLong("UID"); + if (objectUUID > 0) + guild = GET_GUILD(objectUUID); + } } catch (SQLException e) { Logger.error(e); } diff --git a/src/engine/db/handlers/dbItemHandler.java b/src/engine/db/handlers/dbItemHandler.java index 9615bfe9..38b43943 100644 --- a/src/engine/db/handlers/dbItemHandler.java +++ b/src/engine/db/handlers/dbItemHandler.java @@ -95,11 +95,12 @@ public class dbItemHandler extends dbHandlerBase { ResultSet rs = preparedStatement.executeQuery(); - int objectUUID = (int) rs.getLong("UID"); - - if (objectUUID > 0) - return GET_ITEM(objectUUID); + if (rs.next()) { + int objectUUID = (int) rs.getLong("UID"); + if (objectUUID > 0) + return GET_ITEM(objectUUID); + } } catch (SQLException e) { Logger.error(e); } diff --git a/src/engine/db/handlers/dbMobHandler.java b/src/engine/db/handlers/dbMobHandler.java index eeeb8439..0081f67e 100644 --- a/src/engine/db/handlers/dbMobHandler.java +++ b/src/engine/db/handlers/dbMobHandler.java @@ -57,11 +57,12 @@ public class dbMobHandler extends dbHandlerBase { ResultSet rs = preparedStatement.executeQuery(); - int objectUUID = (int) rs.getLong("UID"); - - if (objectUUID > 0) - mobile = GET_MOB(objectUUID); + if (rs.next()) { + int objectUUID = (int) rs.getLong("UID"); + if (objectUUID > 0) + mobile = GET_MOB(objectUUID); + } } catch (SQLException e) { throw new RuntimeException(e); } diff --git a/src/engine/db/handlers/dbNPCHandler.java b/src/engine/db/handlers/dbNPCHandler.java index 2199d9a7..b718ab25 100644 --- a/src/engine/db/handlers/dbNPCHandler.java +++ b/src/engine/db/handlers/dbNPCHandler.java @@ -56,11 +56,12 @@ public class dbNPCHandler extends dbHandlerBase { ResultSet rs = preparedStatement.executeQuery(); - int objectUUID = (int) rs.getLong("UID"); - - if (objectUUID > 0) - npc = GET_NPC(objectUUID); + if (rs.next()) { + int objectUUID = (int) rs.getLong("UID"); + if (objectUUID > 0) + npc = GET_NPC(objectUUID); + } } catch (SQLException e) { throw new RuntimeException(e); } diff --git a/src/engine/db/handlers/dbPlayerCharacterHandler.java b/src/engine/db/handlers/dbPlayerCharacterHandler.java index 06a4d595..99d771c4 100644 --- a/src/engine/db/handlers/dbPlayerCharacterHandler.java +++ b/src/engine/db/handlers/dbPlayerCharacterHandler.java @@ -61,11 +61,13 @@ public class dbPlayerCharacterHandler extends dbHandlerBase { ResultSet rs = preparedStatement.executeQuery(); - int objectUUID = (int) rs.getLong("UID"); + if (rs.next()) { - if (objectUUID > 0) - playerCharacter = GET_PLAYER_CHARACTER(objectUUID); + int objectUUID = (int) rs.getLong("UID"); + if (objectUUID > 0) + playerCharacter = GET_PLAYER_CHARACTER(objectUUID); + } } catch (SQLException e) { Logger.error(e); }