diff options
Diffstat (limited to 'src')
-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) { |