From 8df0078989f68064b31dc96f75310411a54c8a10 Mon Sep 17 00:00:00 2001 From: Volodymyr Babak Date: Mon, 12 Dec 2022 16:02:38 +0200 Subject: [PATCH] TbEntityDataSubCtx. getCurrentAggregation() - if curTsCmd or curTsCmd.getAgg is null - return NONE --- .../server/service/subscription/TbEntityDataSubCtx.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/src/main/java/org/thingsboard/server/service/subscription/TbEntityDataSubCtx.java b/application/src/main/java/org/thingsboard/server/service/subscription/TbEntityDataSubCtx.java index 7efae57443..016ed198ec 100644 --- a/application/src/main/java/org/thingsboard/server/service/subscription/TbEntityDataSubCtx.java +++ b/application/src/main/java/org/thingsboard/server/service/subscription/TbEntityDataSubCtx.java @@ -89,7 +89,7 @@ public class TbEntityDataSubCtx extends TbAbstractDataSubCtx { @Override protected Aggregation getCurrentAggregation() { - return this.curTsCmd.getAgg() != null ? this.curTsCmd.getAgg() : Aggregation.NONE; + return (this.curTsCmd == null || this.curTsCmd.getAgg() == null) ? Aggregation.NONE : this.curTsCmd.getAgg(); } private void sendLatestWsMsg(EntityId entityId, String sessionId, TelemetrySubscriptionUpdate subscriptionUpdate, EntityKeyType keyType) {