diff --git a/middleware/confidenceScore.js b/middleware/confidenceScore.js index b100b973..0eae0f8d 100644 --- a/middleware/confidenceScore.js +++ b/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; }