From 9aca556dd3c4dbea3f146532cbf97df8dfa17885 Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Mon, 24 Jul 2017 15:54:10 -0400 Subject: [PATCH] switch to simpler check since we know what's coming back --- controller/libpostal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/libpostal.js b/controller/libpostal.js index d7a5ab2d..6c913cd7 100644 --- a/controller/libpostal.js +++ b/controller/libpostal.js @@ -12,7 +12,7 @@ function setup(should_execute) { // parse text with query parser const parsed_text = text_analyzer.parse(req.clean.text); - if (!_.isUndefined(parsed_text)) { + if (parsed_text !== undefined) { // if a known ISO2 country was parsed, convert it to ISO3 if (_.has(parsed_text, 'country') && iso3166.is2(_.toUpper(parsed_text.country))) { parsed_text.country = iso3166.to3(_.toUpper(parsed_text.country));