Browse Source

Check that hit.address exists

Fixes #379
pull/378/head
Julian Simioni 9 years ago
parent
commit
033345dbb3
  1. 3
      middleware/confidenceScore.js

3
middleware/confidenceScore.js

@ -100,7 +100,8 @@ function checkForDealBreakers(req, hit) {
return true;
}
if (check.assigned(req.clean.parsed_text.postalcode) && req.clean.parsed_text.postalcode !== hit.address.zip) {
if (check.assigned(req.clean.parsed_text.postalcode) && check.assigned(hit.address) &&
req.clean.parsed_text.postalcode !== hit.address.zip) {
logger.debug('[confidence][deal-breaker]: postalcode !== zip (' + req.clean.parsed_text.postalcode + ' !== ' + hit.address.zip + ')');
return true;
}

Loading…
Cancel
Save