Author: bpoussin Date: 2011-05-30 13:10:08 +0200 (Mon, 30 May 2011) New Revision: 73 Url: http://chorem.org/repositories/revision/vradi/73 Log: init VradiUser collection if null Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RegisterAction.java trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RestoreUserAction.java Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RegisterAction.java =================================================================== --- trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RegisterAction.java 2011-05-30 10:58:46 UTC (rev 72) +++ trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RegisterAction.java 2011-05-30 11:10:08 UTC (rev 73) @@ -1,5 +1,7 @@ package org.chorem.vradi.actions; +import freemarker.template.utility.Collections12; +import java.util.Collections; import javax.mail.MessagingException; import javax.mail.internet.AddressException; import javax.servlet.http.HttpServletRequest; @@ -116,6 +118,8 @@ String md5 = StringUtil.encodeMD5(password); newUser.setPassword(md5); newUser.setLogin(email); + newUser.setNoSend(Collections.EMPTY_SET); + newUser.setNoReceived(Collections.EMPTY_SET); VradiUser login = proxy.store(newUser); //Stores the new user //If there was an error when storing the user Modified: trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RestoreUserAction.java =================================================================== --- trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RestoreUserAction.java 2011-05-30 10:58:46 UTC (rev 72) +++ trunk/vradi-web/src/main/java/org/chorem/vradi/actions/RestoreUserAction.java 2011-05-30 11:10:08 UTC (rev 73) @@ -3,6 +3,7 @@ import static org.nuiton.i18n.I18n._; import com.opensymphony.xwork2.ActionContext; +import java.util.Collections; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.vradi.entities.VradiUser; @@ -52,6 +53,14 @@ log.debug(String.format("User '%s' is %s: ", userId, user)); if (user != null) { + // if collection is not initialized put empty collection + if (user.getNoSend() == null) { + user.setNoSend(Collections.EMPTY_SET); + } + if (user.getNoReceived() == null) { + user.setNoReceived(Collections.EMPTY_SET); + } + if (user.getInfo() == null) { infoHtml = _("vradi.user.noinfo"); } else {