Skip to content

Commit 4796443

Browse files
author
sachin-maheshwari
authored
Merge pull request #198 from topcoder-platform/dev
hotfix to fix country code logic checking
2 parents 4969dd1 + f34025f commit 4796443

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/common/broadcastAPIHelper.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ async function filterOnMemberCondition(userId, bulkMessage, m) {
136136
if (_.indexOf(memberSkills, s.toLowerCase()) >= 0) {
137137
skillMatch = true
138138
logger.info(`BroadcastMessageId: ${bulkMessage.id},` +
139-
` '${s}' skill matached for user id ${userId}`)
139+
` '${s}' skill matched for user id ${userId}`)
140140
}
141141
})
142142
} else {
@@ -169,13 +169,13 @@ async function filterOnMemberCondition(userId, bulkMessage, m) {
169169
trackMatch = true // no condition, means allow for all
170170
}
171171

172-
if (countryCodes.length > 0) {
172+
if (countryCodes && (countryCodes.length > 0)) {
173173
const mcc = _.get(m[0], 'competitionCountryCode') // get member country code
174174
countryCodeMatch = false
175175
if (_.indexOf(countryCodes, mcc) >= 0) {
176176
countryCodeMatch = true
177177
logger.info(`BroadcastMessageId: ${bulkMessage.id},` +
178-
` '${mcc}' country code matached for user id ${userId}`)
178+
` '${mcc}' country code matched for user id ${userId}`)
179179
}
180180
} else {
181181
countryCodeMatch = true // no codition on country code

0 commit comments

Comments
 (0)