diff options
author | Vitaly Takmazov | 2016-06-27 14:15:09 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-06-27 14:15:09 +0300 |
commit | 9d182aa45b5e2428ba684973837a8d035c0d50a2 (patch) | |
tree | 8a5fa04cb91c80e19c4e8359daf1a88f23c3f801 /src/main/java/com | |
parent | 4683d6b828d2bf6d56a53205c785f7982ce1be11 (diff) |
fixes
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/juick/server/UserQueries.java | 8 |
1 files changed, 6 insertions, 2 deletions
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<User> getUsersByName(JdbcTemplate sql, List<String> unames) { |