diff --git a/hsarback/src/de/hsadmin/mods/email/EMailAddress.java b/hsarback/src/de/hsadmin/mods/email/EMailAddress.java index 5dd2c89..dcd2ee0 100644 --- a/hsarback/src/de/hsadmin/mods/email/EMailAddress.java +++ b/hsarback/src/de/hsadmin/mods/email/EMailAddress.java @@ -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; } diff --git a/hsarback/src/de/hsadmin/mods/email/EMailAddressModuleImpl.java b/hsarback/src/de/hsadmin/mods/email/EMailAddressModuleImpl.java index e8447cd..175ef4e 100644 --- a/hsarback/src/de/hsadmin/mods/email/EMailAddressModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/email/EMailAddressModuleImpl.java @@ -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) {