fix error in handling of empty subdomain-property

This commit is contained in:
Peter Hormanns 2013-01-21 13:40:17 +01:00
parent 5056e46610
commit 6b27737db6
2 changed files with 5 additions and 2 deletions

View File

@ -66,8 +66,8 @@ public class EMailAddress extends AbstractEntity implements Serializable {
public EMailAddress(String localpart, String subdomain, Domain domain, public EMailAddress(String localpart, String subdomain, Domain domain,
String target) { String target) {
this.localpart = localpart; this.localpart = trimToEmpty(localpart);
this.subdomain = subdomain; this.subdomain = trimToNull(subdomain);
this.domain = domain; this.domain = domain;
this.target = target; this.target = target;
} }

View File

@ -35,6 +35,9 @@ public class EMailAddressModuleImpl extends AbstractModuleImpl {
if (adr.getLocalpart() == null) { if (adr.getLocalpart() == null) {
adr.setLocalpart(""); adr.setLocalpart("");
} }
if (adr.getSubdomain() == null) {
adr.setSubdomain("");
}
if (adr.getDomain() == null if (adr.getDomain() == null
|| adr.getDomain().getName() == null || adr.getDomain().getName() == null
|| adr.getDomain().getName().length() == 0) { || adr.getDomain().getName().length() == 0) {