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,
String target) {
this.localpart = localpart;
this.subdomain = subdomain;
this.localpart = trimToEmpty(localpart);
this.subdomain = trimToNull(subdomain);
this.domain = domain;
this.target = target;
}

View File

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