From 9f96d6a5bd9ae3785fc0c607fb0c3fbe26c254de Mon Sep 17 00:00:00 2001 From: Sachin Maheshwari Date: Thu, 30 Apr 2020 16:22:00 +0530 Subject: [PATCH] correcting condition --- src/common/broadcastAPIHelper.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/broadcastAPIHelper.js b/src/common/broadcastAPIHelper.js index 1feb73d..de6cd9f 100644 --- a/src/common/broadcastAPIHelper.js +++ b/src/common/broadcastAPIHelper.js @@ -136,7 +136,7 @@ async function filterOnMemberCondition(userId, bulkMessage, m) { if (_.indexOf(memberSkills, s.toLowerCase()) >= 0) { skillMatch = true logger.info(`BroadcastMessageId: ${bulkMessage.id},` + - ` '${s}' skill matached for user id ${userId}`) + ` '${s}' skill matched for user id ${userId}`) } }) } else { @@ -169,13 +169,13 @@ async function filterOnMemberCondition(userId, bulkMessage, m) { trackMatch = true // no condition, means allow for all } - if (countryCodes.length > 0) { + if (countryCodes && (countryCodes.length > 0)) { const mcc = _.get(m[0], 'competitionCountryCode') // get member country code countryCodeMatch = false if (_.indexOf(countryCodes, mcc) >= 0) { countryCodeMatch = true logger.info(`BroadcastMessageId: ${bulkMessage.id},` + - ` '${mcc}' country code matached for user id ${userId}`) + ` '${mcc}' country code matched for user id ${userId}`) } } else { countryCodeMatch = true // no codition on country code