Fix email not getting updated in database #527

This commit is contained in:
DNx5 2016-02-19 23:25:25 +07:00
parent 6dfdcf103b
commit 05e79e6356

View File

@ -46,10 +46,12 @@ public class AsyncAddEmail {
messages.send(player, MessageKey.INVALID_EMAIL);
} else if (dataSource.isEmailStored(email)) {
messages.send(player, MessageKey.EMAIL_ALREADY_USED_ERROR);
} else {
} else if (dataSource.updateEmail(auth)) {
auth.setEmail(email);
playerCache.updatePlayer(auth);
messages.send(player, MessageKey.EMAIL_ADDED_SUCCESS);
} else {
messages.send(player, MessageKey.ERROR);
}
} else {
sendUnloggedMessage(dataSource);