OFAC flow fix (#137)

* 7.0.1

* OFAC flow fix
This commit is contained in:
Fabio Cigliano 2018-07-31 11:55:35 +02:00 committed by Josh Harvey
parent 49f8b66de0
commit 9fc79f1bb4
4 changed files with 11 additions and 9 deletions

View file

@ -6,6 +6,7 @@ const matcher = require('./matching')
const nameUtils = require('./name-utils')
const options = require('../options')
const _ = require('lodash/fp')
const logger = require('../logger')
const debugLog = require('../pp')(__filename) // KOSTIS TODO: remove
@ -42,13 +43,13 @@ function makeCompatible (nameParts) {
function match (nameParts, birthDateString, options) {
const {debug} = options
if (!structs) {
const message = 'The OFAC data sources have not been loaded yet.'
return Promise.reject(new Error(message))
logger.error(new Error('The OFAC data sources have not been loaded yet.'))
return false
}
// Prepare the input data
const parts = makeCompatible(nameParts)
const fullName = nameUtils.makeFullName(parts)
const words = nameUtils.makeWords(fullName)