Skip to content

Commit

Permalink
Merge pull request #25 from bizon/tusbar/fix-unknown-region
Browse files Browse the repository at this point in the history
Return empty array if mwsRegion does not exist
  • Loading branch information
tusbar authored Jun 18, 2020
2 parents 056ef7c + 1288497 commit 1af270c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ exports.getMarketplacesByMwsDomain = memoize(domain => {
})

exports.getMarketplacesByMwsRegion = memoize(mwsRegion => {
return this.getMarketplacesByMwsDomain(
mwsRegionDomains[String(mwsRegion).toLowerCase()]
)
const mwsDomain = mwsRegionDomains[String(mwsRegion).toLowerCase()]

if (!mwsDomain) {
return []
}

return this.getMarketplacesByMwsDomain(mwsDomain)
})

0 comments on commit 1af270c

Please sign in to comment.