From e8b870c7bae2d7d97193abd4ed0bd13b86bc50a1 Mon Sep 17 00:00:00 2001 From: e3dio <85405955+e3dio@users.noreply.github.com> Date: Sat, 20 Nov 2021 12:37:46 -0700 Subject: [PATCH] Can't unsubscribe without subscriber (#1383) --- src/WebSocket.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/WebSocket.h b/src/WebSocket.h index 68965fb..682ae11 100644 --- a/src/WebSocket.h +++ b/src/WebSocket.h @@ -247,6 +247,8 @@ public: ); WebSocketData *webSocketData = (WebSocketData *) us_socket_ext(SSL, (us_socket_t *) this); + + if (!webSocketData->subscriber) { return false; } /* Cannot return numSubscribers as this is only for this particular websocket context */ auto [ok, last] = webSocketContextData->topicTree->unsubscribe(webSocketData->subscriber, topic);