Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/common/broadcastAPIHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down