skip hive attribute if it is missing

This commit is contained in:
Peter Hormanns 2022-08-08 12:42:49 +02:00
parent d026203c91
commit ed03299d08

View File

@ -23,7 +23,10 @@ public class PacRemote extends AbstractRemote {
Pac pac = (Pac) entity; Pac pac = (Pac) entity;
resultMap.put("name", pac.getName()); resultMap.put("name", pac.getName());
resultMap.put("id", Long.toString(pac.getId())); resultMap.put("id", Long.toString(pac.getId()));
resultMap.put("hive", pac.getHiveName()); final String hiveName = pac.getHiveName();
if (hiveName != null && !hiveName.isEmpty()) {
resultMap.put("hive", hiveName);
}
resultMap.put("customer", pac.getCustomer().getName()); resultMap.put("customer", pac.getCustomer().getName());
resultMap.put("curinetaddr", pac.getCurINetAddr().getInet4Addr()); resultMap.put("curinetaddr", pac.getCurINetAddr().getInet4Addr());
resultMap.put("created", TextUtil.format(pac.getCreated())); resultMap.put("created", TextUtil.format(pac.getCreated()));