From b43fa0a5acc122ebbf3a0c7f28a28f8a052a2e9c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 10 Jun 2017 01:37:57 +0300 Subject: www: fix exception when email options is not set --- juick-server/src/main/java/com/juick/service/UserServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/juick-server/src/main/java/com/juick/service/UserServiceImpl.java b/juick-server/src/main/java/com/juick/service/UserServiceImpl.java index 1b33a6d3..0b8ed13b 100644 --- a/juick-server/src/main/java/com/juick/service/UserServiceImpl.java +++ b/juick-server/src/main/java/com/juick/service/UserServiceImpl.java @@ -640,7 +640,7 @@ public class UserServiceImpl extends BaseJdbcService implements UserService { List list = getJdbcTemplate().query( "SELECT email,subscr_hour FROM emails WHERE user_id=? AND subscr_hour IS NOT NULL", (rs, num) -> new EmailOpts(rs.getString(1), rs.getInt(2)), user.getUid()); - return list.isEmpty() ? null : list.get(0); + return list.isEmpty() ? new EmailOpts("", 0) : list.get(0); } @Transactional(readOnly = true) -- cgit v1.2.3