Browse Source

Added proper handle of null additional info

pull/5038/head
Volodymyr Babak 5 years ago
parent
commit
94cf676d97
  1. 6
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/RelationMsgConstructor.java

6
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/RelationMsgConstructor.java

@ -37,8 +37,10 @@ public class RelationMsgConstructor {
.setToIdMSB(entityRelation.getTo().getId().getMostSignificantBits())
.setToIdLSB(entityRelation.getTo().getId().getLeastSignificantBits())
.setToEntityType(entityRelation.getTo().getEntityType().name())
.setType(entityRelation.getType())
.setAdditionalInfo(JacksonUtil.toString(entityRelation.getAdditionalInfo()));
.setType(entityRelation.getType());
if (entityRelation.getAdditionalInfo() != null) {
builder.setAdditionalInfo(JacksonUtil.toString(entityRelation.getAdditionalInfo()));
}
if (entityRelation.getTypeGroup() != null) {
builder.setTypeGroup(getStringValue(entityRelation.getTypeGroup().name()));
}

Loading…
Cancel
Save