From 10f860dc0ceb21a3bbd5d6757253cc85510afd60 Mon Sep 17 00:00:00 2001 From: Mike <76-Mike@users.noreply.git.krews.org> Date: Sun, 7 Jun 2020 02:58:38 +0200 Subject: [PATCH] Add catch. --- .../messages/outgoing/modtool/ModToolUserInfoComposer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolUserInfoComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolUserInfoComposer.java index d0322384..e1bb135c 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolUserInfoComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolUserInfoComposer.java @@ -28,16 +28,21 @@ public class ModToolUserInfoComposer extends MessageComposer { this.response.init(Outgoing.ModToolUserInfoComposer); try { int totalBans = 0; - try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT COUNT(*) AS amount FROM bans WHERE user_id = ?")) { + + try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); + PreparedStatement statement = connection.prepareStatement("SELECT COUNT(*) AS amount FROM bans WHERE user_id = ?")) { statement.setInt(1, this.set.getInt("user_id")); try (ResultSet set = statement.executeQuery()) { if (set.next()) { totalBans = set.getInt("totalBans"); } + } catch (SQLException e) { + LOGGER.error("Caught SQL exception", e); } } catch (SQLException e) { LOGGER.error("Caught SQL exception", e); } + this.response.appendInt(this.set.getInt("user_id")); this.response.appendString(this.set.getString("username")); this.response.appendString(this.set.getString("look"));