aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/UserQueries.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-06-27 13:29:51 +0300
committerGravatar Vitaly Takmazov2016-06-27 13:29:51 +0300
commit4683d6b828d2bf6d56a53205c785f7982ce1be11 (patch)
treee795c09347edf170169df02fb579f416dcad0366 /src/main/java/com/juick/server/UserQueries.java
parent6362eab34390b187944c7e3c12eb444e2fb2c455 (diff)
fixes
Diffstat (limited to 'src/main/java/com/juick/server/UserQueries.java')
-rw-r--r--src/main/java/com/juick/server/UserQueries.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/com/juick/server/UserQueries.java b/src/main/java/com/juick/server/UserQueries.java
index e7aee0f5..f071de39 100644
--- a/src/main/java/com/juick/server/UserQueries.java
+++ b/src/main/java/com/juick/server/UserQueries.java
@@ -100,8 +100,8 @@ public class UserQueries {
public static User getUserByName(JdbcTemplate sql, String username) {
try {
return sql.queryForObject("SELECT id,nick,banned FROM users WHERE nick=?",
- new Object[]{username},
- new UserMapper());
+ new UserMapper(),
+ username);
} catch (EmptyResultDataAccessException e) {
return null;
}
@@ -259,8 +259,12 @@ public class UserQueries {
}
public static boolean isInWL(JdbcTemplate sql, int uid, int check) {
- return sql.queryForObject("SELECT 1 FROM wl_users WHERE user_id=? AND wl_user_id=?",
- new Object[] {uid, check}, Integer.class) == 1;
+ try {
+ return sql.queryForObject("SELECT 1 FROM wl_users WHERE user_id=? AND wl_user_id=?",
+ Integer.class, uid, check) == 1;
+ } catch (EmptyResultDataAccessException e) {
+ return false;
+ }
}
public static boolean isInBL(JdbcTemplate sql, int uid, int check) {