Browse Source

add validation for empty list of attributes in save attributes node

pull/7238/head
ShvaykaD 4 years ago
parent
commit
57eab8d73c
  1. 4
      rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/telemetry/TbMsgAttributesNode.java

4
rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/telemetry/TbMsgAttributesNode.java

@ -66,6 +66,10 @@ public class TbMsgAttributesNode implements TbNode {
}
String src = msg.getData();
List<AttributeKvEntry> attributes = new ArrayList<>(JsonConverter.convertToAttributes(new JsonParser().parse(src)));
if (attributes.isEmpty()) {
ctx.tellSuccess(msg);
return;
}
String notifyDeviceStr = msg.getMetaData().getValue("notifyDevice");
ctx.getTelemetryService().saveAndNotify(
ctx.getTenantId(),

Loading…
Cancel
Save