aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/service
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/service')
-rw-r--r--src/main/java/com/juick/service/UserServiceImpl.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/com/juick/service/UserServiceImpl.java b/src/main/java/com/juick/service/UserServiceImpl.java
index 99e56229..5ae0b2d1 100644
--- a/src/main/java/com/juick/service/UserServiceImpl.java
+++ b/src/main/java/com/juick/service/UserServiceImpl.java
@@ -370,10 +370,13 @@ public class UserServiceImpl extends BaseJdbcService implements UserService {
@Transactional(readOnly = true)
@Override
public boolean isInBL(final int uid, final int check) {
- List<Integer> list = getJdbcTemplate().queryForList(
- "SELECT 1 FROM bl_users WHERE user_id = ? AND bl_user_id = ?", Integer.class, uid, check);
+ if (check > 0) {
+ List<Integer> list = getJdbcTemplate().queryForList(
+ "SELECT 1 FROM bl_users WHERE user_id = ? AND bl_user_id = ?", Integer.class, uid, check);
- return !list.isEmpty() && list.get(0) == 1;
+ return !list.isEmpty() && list.get(0) == 1;
+ }
+ return false;
}
@Transactional(readOnly = true)