Fix NPE in entity data subscription
This commit is contained in:
parent
76bb8f13c0
commit
a3d2eb4c4e
@ -302,7 +302,9 @@ public class DefaultTbEntityDataSubscriptionService implements TbEntityDataSubsc
|
|||||||
Map<Integer, TbAbstractDataSubCtx> sessionSubs = subscriptionsBySessionId.computeIfAbsent(sessionRef.getSessionId(), k -> new HashMap<>());
|
Map<Integer, TbAbstractDataSubCtx> sessionSubs = subscriptionsBySessionId.computeIfAbsent(sessionRef.getSessionId(), k -> new HashMap<>());
|
||||||
TbEntityDataSubCtx ctx = new TbEntityDataSubCtx(serviceId, wsService, entityService, localSubscriptionService,
|
TbEntityDataSubCtx ctx = new TbEntityDataSubCtx(serviceId, wsService, entityService, localSubscriptionService,
|
||||||
attributesService, stats, sessionRef, cmd.getCmdId(), maxEntitiesPerDataSubscription);
|
attributesService, stats, sessionRef, cmd.getCmdId(), maxEntitiesPerDataSubscription);
|
||||||
ctx.setAndResolveQuery(cmd.getQuery());
|
if (cmd.getQuery() != null) {
|
||||||
|
ctx.setAndResolveQuery(cmd.getQuery());
|
||||||
|
}
|
||||||
sessionSubs.put(cmd.getCmdId(), ctx);
|
sessionSubs.put(cmd.getCmdId(), ctx);
|
||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -107,7 +107,7 @@ public abstract class TbAbstractDataSubCtx<T extends AbstractDataQuery<? extends
|
|||||||
public void setAndResolveQuery(T query) {
|
public void setAndResolveQuery(T query) {
|
||||||
dynamicValues.clear();
|
dynamicValues.clear();
|
||||||
this.query = query;
|
this.query = query;
|
||||||
if (query.getKeyFilters() != null) {
|
if (query != null && query.getKeyFilters() != null) {
|
||||||
for (KeyFilter filter : query.getKeyFilters()) {
|
for (KeyFilter filter : query.getKeyFilters()) {
|
||||||
registerDynamicValues(filter.getPredicate());
|
registerDynamicValues(filter.getPredicate());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user