From 9d182aa45b5e2428ba684973837a8d035c0d50a2 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 27 Jun 2016 14:15:09 +0300 Subject: fixes --- src/main/java/com/juick/server/UserQueries.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/com/juick/server/UserQueries.java b/src/main/java/com/juick/server/UserQueries.java index f071de39..3a0e03ba 100644 --- a/src/main/java/com/juick/server/UserQueries.java +++ b/src/main/java/com/juick/server/UserQueries.java @@ -108,8 +108,12 @@ public class UserQueries { } public static User getUserByJID(JdbcTemplate sql, String jid) { - return sql.queryForObject("SELECT id,nick,banned FROM users WHERE id=(SELECT user_id FROM jids WHERE jid=?)", - new UserMapper(), jid); + try { + return sql.queryForObject("SELECT id,nick,banned FROM users WHERE id=(SELECT user_id FROM jids WHERE jid=?)", + new UserMapper(), jid); + } catch (EmptyResultDataAccessException e) { + return null; + } } public static List getUsersByName(JdbcTemplate sql, List unames) { -- cgit v1.2.3