fix email-target mapping from hsscript

This commit is contained in:
Peter Hormanns 2018-07-05 15:12:22 +02:00
parent bde85859a3
commit a6a2298a5c

View File

@ -55,8 +55,8 @@ public class EMailAddressRemote extends AbstractRemote {
} }
Object l = map.get("target"); Object l = map.get("target");
if (l != null && l instanceof Object[]) { if (l != null && l instanceof Object[]) {
StringBuffer tBuff = new StringBuffer(); final StringBuffer tBuff = new StringBuffer();
Object[] targetObjArray = (Object[]) l; final Object[] targetObjArray = (Object[]) l;
for (int idx=0; idx<targetObjArray.length; idx++) { for (int idx=0; idx<targetObjArray.length; idx++) {
if (targetObjArray[idx] instanceof String) { if (targetObjArray[idx] instanceof String) {
if (tBuff.length() > 0) { if (tBuff.length() > 0) {
@ -66,6 +66,18 @@ public class EMailAddressRemote extends AbstractRemote {
} }
} }
adr.setTarget(tBuff.toString()); adr.setTarget(tBuff.toString());
} else if ((l != null && l instanceof Map<?, ?>)) {
final StringBuffer tBuff = new StringBuffer();
final Map<? ,?> targetObjMap = (Map<?, ?>) l;
for (Object targetObj : targetObjMap.values()) {
if (targetObj instanceof String) {
if (tBuff.length() > 0) {
tBuff.append(',');
}
tBuff.append((String) targetObj);
}
}
adr.setTarget(tBuff.toString());
} else { } else {
if (l != null && l instanceof String) { if (l != null && l instanceof String) {
adr.setTarget((String) l); adr.setTarget((String) l);