From 46cc0ae8d00e87360ae07561767dabc890dd816c Mon Sep 17 00:00:00 2001 From: Alex Unger Date: Thu, 6 Jan 2022 17:55:05 -0800 Subject: [PATCH] update the param validation the vars that should exist are channels and channelTimetokens --- src/core/endpoints/history/message_counts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/endpoints/history/message_counts.js b/src/core/endpoints/history/message_counts.js index fa0a3e93a..d3f37714f 100644 --- a/src/core/endpoints/history/message_counts.js +++ b/src/core/endpoints/history/message_counts.js @@ -19,7 +19,7 @@ export function validateParams(modules: ModulesInject, incomingParams: MessageCo if (!channels) return 'Missing channel'; if (timetoken && channelTimetokens) return 'timetoken and channelTimetokens are incompatible together'; - if ((timetoken && channelTimetokens) && (channelTimetokens.length > 1) && (channels.length !== channelTimetokens.length)) return 'Length of channelTimetokens and channels do not match'; + if ((channels && channelTimetokens) && (channelTimetokens.length > 1) && (channels.length !== channelTimetokens.length)) return 'Length of channelTimetokens and channels do not match'; if (!config.subscribeKey) return 'Missing Subscribe Key'; }