aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-06-27 14:15:09 +0300
committerGravatar Vitaly Takmazov2016-06-27 14:15:09 +0300
commit9d182aa45b5e2428ba684973837a8d035c0d50a2 (patch)
tree8a5fa04cb91c80e19c4e8359daf1a88f23c3f801
parent4683d6b828d2bf6d56a53205c785f7982ce1be11 (diff)
fixes
-rw-r--r--src/main/java/com/juick/server/UserQueries.java8
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) {