From 91df97a8ecb5d10bf9ed3af9bf4f11d54533cc39 Mon Sep 17 00:00:00 2001 From: Sarthak Aggarwal Date: Tue, 14 Jan 2025 20:37:27 -0800 Subject: [PATCH] rebasing with updated client command Signed-off-by: Sarthak Aggarwal --- src/networking.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/networking.c b/src/networking.c index 457bf4f12d..1fdf464d03 100644 --- a/src/networking.c +++ b/src/networking.c @@ -3747,24 +3747,24 @@ static int clientMatchesFlagFilter(client *c, const char *flag_filter) { } static int clientSubscribedToChannel(client *client, robj *channel) { - if (client == NULL || client->pubsub_channels == NULL) { + if (client == NULL || client->pubsub_data == NULL || client->pubsub_data->pubsub_channels == NULL) { return 0; } - return dictFind(client->pubsub_channels, channel) != NULL; + return dictFind(client->pubsub_data->pubsub_channels, channel) != NULL; } static int clientSubscribedToShardChannel(client *client, robj *channel) { - if (client == NULL || client->pubsubshard_channels == NULL) { + if (client == NULL || client->pubsub_data == NULL || client->pubsub_data->pubsubshard_channels == NULL) { return 0; } - return dictFind(client->pubsubshard_channels, channel) != NULL; + return dictFind(client->pubsub_data->pubsubshard_channels, channel) != NULL; } static int clientSubscribedToPattern(client *client, robj *pattern) { - if (client == NULL || client->pubsub_patterns == NULL) { + if (client == NULL || client->pubsub_data == NULL || client->pubsub_data->pubsub_patterns == NULL) { return 0; } - return dictFind(client->pubsub_patterns, pattern) != NULL; + return dictFind(client->pubsub_data->pubsub_patterns, pattern) != NULL; }