From 8cf7e7386282095699f5f7a46be634ab8463baab Mon Sep 17 00:00:00 2001 From: uNetworkingAB <110806833+uNetworkingAB@users.noreply.github.com> Date: Mon, 2 Jan 2023 18:21:05 +0100 Subject: [PATCH] WebSocket subscription handler broken --- src/WebSocket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WebSocket.h b/src/WebSocket.h index be87544..c6d163b 100644 --- a/src/WebSocket.h +++ b/src/WebSocket.h @@ -196,7 +196,7 @@ public: Super::timeout(webSocketContextData->idleTimeoutComponents.second); /* At this point we iterate all currently held subscriptions and emit an event for all of them */ - if (webSocketContextData->subscriptionHandler) { + if (webSocketData->subscriber && webSocketContextData->subscriptionHandler) { for (Topic *t : webSocketData->subscriber->topics) { webSocketContextData->subscriptionHandler(this, t->name, (int) t->size() - 1, (int) t->size()); }