From 77aa3f0080575c583fdbd27ce6d216016d764574 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 27 Mar 2017 13:20:20 +0300 Subject: juick-www: fix adding email --- juick-www/src/main/java/com/juick/www/controllers/Settings.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'juick-www/src/main') diff --git a/juick-www/src/main/java/com/juick/www/controllers/Settings.java b/juick-www/src/main/java/com/juick/www/controllers/Settings.java index e6e763b1..053a014e 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/Settings.java +++ b/juick-www/src/main/java/com/juick/www/controllers/Settings.java @@ -29,7 +29,6 @@ import org.apache.commons.lang3.StringUtils; import org.imgscalr.Scalr; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; @@ -209,9 +208,7 @@ public class Settings { } break; case "email-add": - try { - emailService.verifyAddressByCode(visitor.getUid(), request.getParameter("account")); - } catch (EmptyResultDataAccessException e) { + if (!emailService.verifyAddressByCode(visitor.getUid(), request.getParameter("account"))) { String authCode = UserUtils.generateHash(8); if (emailService.addVerificationCode(visitor.getUid(), request.getParameter("account"), authCode)) { Session session = Session.getDefaultInstance(System.getProperties()); -- cgit v1.2.3